Changing the URL Property of Web Service Dynamically

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
 
R

Roberto M. Oliva

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
 
M

Mohammad Abu Sharkh

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top