views:

707

answers:

2

I have an application targeting the 2.0 .NET framework. The solution is using the VS web service reference folder. A grep through the solution reveals that this URL lives in a handful of files. However in the deployed application a search shows that the URL lives in only the .config. So what happened to the .disco and .wsdl? Are they compiled into the .exe? Basically, I need to update the URL and I need to know if this requires a new build.

Thanks!

+1  A: 

Yes, you can change the URL that's being referenced at runtime.

If it's in a .config file, IIS will your app should detect the change in the .config file and load the new value. If not, then you'd have to restart the client. Perhaps you can stop and start the Web Site in IIS.

Further, you can definitely WRITE your code to read from a .config file.

  var myWS = new MyWebService();
  myWS.Url = WebServiceURL;
  myWS.SomeMethod();                     

private static string WebServiceURL { 
   get { return ConfigurationManager.AppSettings["MyWebServiceURL"].ToString(); }           }

Meanwhile in your .config file, you have:

  <appSettings>
    <add key="MyWebServiceURL" value="http://blah/foo/bar.asmx" />
  </appSettings>
p.campbell
@pcampbell: It make sense to me.
Syed Tayyab Ali
I'm talking about the client application's config to point to the correct URL. Not the web service running at the server. Why would i reset IIS?
Nick
I had the scenario in mind of a web app picking up the setting from the .config file.
p.campbell
A: 

You can change the url in the web config (if the webservice remains unaltered. Not so sure if the webService as changed)

Sergio