Urgent: how to reference a webservice at runtime from Pocket PC?
-
hi all, My pocket PC app allows user to configure WebServer's IP address, so I have to reference a webservice at runtime. Adding "webreference" at design time is created proxy class that's stuck with hard-coded Webserver IP. Can anyone help me this matter? Many thanks, Regards, K
-
hi all, My pocket PC app allows user to configure WebServer's IP address, so I have to reference a webservice at runtime. Adding "webreference" at design time is created proxy class that's stuck with hard-coded Webserver IP. Can anyone help me this matter? Many thanks, Regards, K
the soaphttpclientprotocol class that the your proxy class derive from has the url property which you can use to do what you want, you can view also the code of the proxy and modify this thing within the derived class. From Greece: Dimitris Iliopoulos dimilio@yahoo.com
-
the soaphttpclientprotocol class that the your proxy class derive from has the url property which you can use to do what you want, you can view also the code of the proxy and modify this thing within the derived class. From Greece: Dimitris Iliopoulos dimilio@yahoo.com
It's not easy and simple as your thought. I've been tried to change URl property at runtime but it's thrown an exception: An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in System.Web.Services.dll Additional information: Server did not recognize the value of HTTP Header SOAPAction: http://MobileServer/WebService1/HelloWorld. FYI: "http://MobileServer/WebService1" is webreference at design time "http://thoantm I can see in so many materials from many forums that we can change URL at run time, but I can't perform that task although I try both Windows App and Pocket PC app. Any help would be very appreciated, K
-
the soaphttpclientprotocol class that the your proxy class derive from has the url property which you can use to do what you want, you can view also the code of the proxy and modify this thing within the derived class. From Greece: Dimitris Iliopoulos dimilio@yahoo.com
I had changed the url of webservice but i did not work. ws on machine "mobileserver" has a method HelloWorld which returns a String "Hello world from Mobileserver" another ws on machine "thoantm" also has a method HellowWrld which returns a String "Hello from ThoaNTM" My code: Dim ws As New mobileserver.OkieWS MsgBox(ws.HelloWord) ws.Url = "http://thoantm/OkieWS/Service1.asmx" MsgBox(ws.Url) ws.HelloWorld()'exception was thrown when invoke this method I met the following exception: An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in System.Web.Services.dll Additional information: System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://mobileserver/OkieWS/Service1/HelloWorld. at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing) I also tried to change the namespace of ws on machine thoantm to "http://mobileserver/OkieWS/Sevice1.asmx" its original namespace is "http://thoantm/OkieWS/Sevice1.asmx" and I met the following exception when I called webmethod of ws on thoantm An unhandled exception of type 'System.Net.WebException' occurred in System.Web.Services.dll Additional information: Unable to connect to the remote server I can not change the url behavior of webreference to dynamic cause i'm coding in .net CF Thanks for ur time. Pls help me! :((