Changing the URL Property of Web Service Dynamically

  • Thread starter Thread starter Galexy Chan
  • Start date Start date
G

Galexy Chan

Dear All,

In my application, i would like to let the users to pick the url of the
web server which hosting the web services that the device going to consume.
I tried to change the url properties of the web service object during
runtime, but it is fail.

But from the help, it said the url can be changed during runtime, anyone
got the similar experience?

Alex
 
Hi

What I do... Is once you have the proxy Class generated, you can change the
constructor, for example to receive a String with the address.
Then is easy to find inside the proxy Class where the fixed address get
called, and then replace it with the String variable with the address
received in the constructor.
This have a downside... if you change the proxy Class due to a change on the
services of the Web Server you have to redo your changes on the proxy Class
again

Hope this helps
Roberto
 
Hi,

You can easily change the URL by changing the URL property in the proxy
class. Every proxy class has a URL property like:

objProxy.URL="http://text/test.asmx"

I did use this tech. in pocket pc and I made my application read the URL
dynamically from a text file.

Thank you,
 
Back
Top