Windows App and Dynamic Web Services

  • Thread starter Thread starter Matt Tapia
  • Start date Start date
M

Matt Tapia

I am writing a windows application that uses a web service however the
location of the web service is not always the same. It seems when I create a
windows application to use the web service, the location of the service is
hard-coded into the application. Is this true or can I change the location
of the web service at run-time?

Thanks!
 
Hi Matt,

You can change web service source address in run time.. by changing constructor of refrence.cs (here i used c#) . Just pass a string value to the constructor.. then use that string as your source.

class myWebService
{
public myWebService(string strSourceUrl)
{
this.url=strSourceUrl;
}
}

at the time of object creation for the webservice.. just write
myWebService objService = new myWebService( "myServer:portNumber\\service");

bye
rajamanickam
 
Back
Top