Urgent: Dynamic webreference ???

  • Thread starter Thread starter Khanh
  • Start date Start date
K

Khanh

Hi all,

Many people say that we can change URL of a webservice at run-time
but it seems it's not as easy as that. My pocket PC app allows to set
up Webserver's IP address dynamically, so I have to change URL at
runtime but I've got 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.

Here is my simple pseudo-code:

Dim ws as WebService1.Service1 = new WebService1.Service1()
ws.URL = "http://thoantm/MyTestWebService/Service1.asmx"
ws.GetServerDate() --> throw exception


I've read a lot of reference material on net but it's really out of my
control, so any help would be very appreciated,
Khanh
 
an unrecognized SOAPAction would be on the server side.
meaning the server could not find the namespace & webMethod that map to the
SOAPAction that was sent,
so the web service cannot be executed and the server returns a SoapFault.
Thanks,
casey
http://www.brains-N-brawn.com
 
Hello there.
try change the property UrlBehaivor of you instance of webservice to true...

[]´s
Carlos Carvalho
 
Back
Top