In my Visual Studio Web application project I am adding a reference to a web service. When I add a web reference the following list of files gets generated.
All these files contains the url pointing to the web service. Even when I move it to a machine without visual studio, it works fine. But if I intend to change the url of the web service, I need to modify all these four files by editing them using notepad.
Instead of this, is there any way I can have the url in the config file and just change it in one place and the web service are pointed to the new location.
I am using framework 1.1.
Set the web service reference "Url Behaviour" property to Dynamic, and the address will be cofigured in your app.config file....
The app.config file should then contain something like
<applicationSettings>
<Exceptions.Properties.Settings>
<setting name="Exceptions_CentreService_CentreService" serializeAs="String">
<value>http://localhost/CentreServiceCompatibility/CentreService.asmx</value>
</setting>
</Exceptions.Properties.Settings>
</applicationSettings>