web reference problem

L

Lloyd Dupont

I'm developing, on my home computer, a WebService and an application
consuming it.
When I added the WebReference I used a local URL.
How could I change this URL?
More than hard coding it to a new value, I want to put it in a Application
Configuration file.
And update dynamically at runtime.

How could I do that?
is it possible to write something like:

MyWebService mws = new MyWebService();
mws.SetUrl(anUrl);
mws.MyWebMethod();

??
 
S

Siva M

You almost got it :)

mws.Url = anUrl;

I'm developing, on my home computer, a WebService and an application
consuming it.
When I added the WebReference I used a local URL.
How could I change this URL?
More than hard coding it to a new value, I want to put it in a Application
Configuration file.
And update dynamically at runtime.

How could I do that?
is it possible to write something like:

MyWebService mws = new MyWebService();
mws.SetUrl(anUrl);
mws.MyWebMethod();

??
 

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