views:

99

answers:

1

I am actually using framework 1.1. I my Web application i am actually adding a reference to a webservice. I am doing this using the Visual studio. When i add a web reference the below list of files get generated.

reference.map

reference.vb

reference.disco

reference.wsdl.

all these files have the url pointing to the webservice. Even when i move it to a machine where there is no visual studio, it works fine. But if i intend to change the url of the webservice, i need to modified all the files opening them in notepad.

Instead of this is there any way so that i can have it in the config file and just change it in one place and the web service is pointed from the new location.

A: 

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&lt;/value&gt;
            </setting>
        </Exceptions.Properties.Settings>
    </applicationSettings>
ZombieSheep