Tuesday, August 26, 2008

Dynamically Changing the WebService

In Web.Config file you need to add the alternate Webservice URL in appSettings

<appSettings>

<add key="AlternateWebServiceURL" value="http://alternatewebservices.com/webservice.asmx"/>

appSettings>

C# Code to dynamically change the WebService

MyWebServiceClass myWebServiceInstance = new MyWebServiceClass ();

myWebServiceInstance.Url = System.Configuration.ConfigurationManager.AppSettings ["AlternateWebServiceURL"];

No comments: