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!
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With