changing a web reference on the fly

  • Thread starter Thread starter Tommy Martin
  • Start date Start date
T

Tommy Martin

If I add a web reference to my code it works fine. I need to know how to
dynamically set the url for the web reference. Sometimes URL's change and
would be nice to let the user enter a new URL in a setup form instead of
having to send out updated code.

Is this possible. If so how?

Thanks.
 
Hi Tommy,

With this information the only thing I can give you is:

Dim url as string = textbox1.text

But I think that was not what you did mean?

Cor
 
set the url property of the web reference...

dim svc as new testWebService.Resource() ' ficticious interface
svc.Url = http://www.someplace.com/yourservice/yourservice.asmx
svc.timeout = 60
etc....

also, i'd think of AllowAutoRedirect if you'd like to have the server
re-route the consumer to another url...bypassing the need, somewhat, for the
user to have to resort to changing their own url. at least as a suppliment
in doing so.

hth,

steve


| If I add a web reference to my code it works fine. I need to know how to
| dynamically set the url for the web reference. Sometimes URL's change and
| would be nice to let the user enter a new URL in a setup form instead of
| having to send out updated code.
|
| Is this possible. If so how?
|
| Thanks.
|
|
 
Back
Top