.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

เขียน webservice ด้วย c#.net ใน c#.net มี security อะไรหรือป่าวครับ Options · View
appear_taa
Posted: Wednesday, August 27, 2008 1:58:13 AM
Rank: มือฝึกหัด
Groups: Member

Joined: 8/27/2008
Posts: 2
Location: aa

[WebMethod]
    public string getName(String id)
        {
            return id;
         }

[WebMethod]
    public string getnum()
        {
          return "num";
        }

คือผมเขียน webservice ด้วย c#.net แล้ว เรียก web method จาก j2me (ksoap) อีกทีนึงอ่ะคับ แล้วปัญหามันมีอยู่ว่า
พอเรียก method "getNum" ซึ่ง method นี้ไม่ต้องใส่พารามิเตอรอะไีรก็ return ค่า "num" ตามปกติ แต่พอเรียก
method "getName" ซึ่งต้องระบบพารามิเตอร์ลงไปด้วย กลับ return ค่า เ้ป็น null คับ คือเหมือนกับว่าที่ตัว c# มี security อะไรไว้หรือป่าว หรือต้องไปปลดล็อคอะไรใน c# ด้วยหรือไม่คับ คือผม debug ใน j2me แล้วคับว่ามันส่งค่าไปจิง
แต่มันติดที่ c# ไม่ยอมรับค่า จาก j2me อ่ะคับ

นี่เป็น code ทาง J2ME ครับ

CODE
SoapObject rpc = new SoapObject("http://tempuri.org", "getName");
rpc.addProperty("id", "1");
HttpTransport httpTrans = new HttpTransport();
httpTrans.setUrl("http://localhost/Test/Service.asmx");
httpTrans.setSoapAction("http://tempuri.org/getName");
httpTrans.debug = true;
Object obj = httpTrans.call(rpc);

 

 

 

 

 

 

 

 

 

 

 

Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by