<p>I have a web reference for our report server embedded in our application. The server that the reports live on could change though, and I'd like to be able to change it "on the fly" if necessary.</p>

<p>I know I've done this before, but can't seem to remember how. Thanks for your help.</p>

<p>I've manually driven around this for the time being. It's not a big deal to set the URL in the code, but I'd like to figure out what the "proper" way of doing this in VS 2008 is. Could anyone provide any further insights? Thanks!</p>

<hr>

<p>In <strong>VS2008</strong> when I change the URL Behavior property to Dynamic I get the following code auto-generated in the Reference class.</p>

<p>Can I override this setting (MySettings) in the web.config? I guess I don't know how the settings stuff works.</p>

<pre><code>Public Sub New()
    MyBase.New
    Me.Url = Global.My.MySettings.Default.Namespace_Reference_ServiceName
    If (Me.IsLocalFileSystemWebService(Me.Url) = true) Then
        Me.UseDefaultCredentials = true
        Me.useDefaultCredentialsSetExplicitly = false
    Else
        Me.useDefaultCredentialsSetExplicitly = true
    End If
End Sub
</code></pre>

<p><em>EDIT</em></p>

<p>So this stuff has changed a bit since VS03 (which was probably the last VS version I used to do this).</p>

<p>According to: <a href="http://msdn.microsoft.com/en-us/library/a65txexh.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/a65txexh.aspx</a> it looks like I have a settings object on which I can set the property programatically, but that I would need to provide the logic to retrieve that URL from the web.config.</p>

<p>Is this the new standard way of doing this in VS2008, or am I missing something?</p>

<p><em>EDIT #2</em></p>

<p>Anyone have any ideas here? I drove around it in my application and just put the URL in my web.config myself and read it out. But I'm not happy with that because it still feels like I'm missing something.</p>

[{'answer_id': 5192, 'author': 'brendan', 'author_id': 225, 'author_profile': 'https://Stackoverflow.com/users/225', 'pm_score': 3, 'selected': True, 'text': '<p>In the properties window change the "behavior" to Dynamic.</p>\n\n<p>See: <a href="http://www.codeproject.com/KB/XML/wsdldynamicurl.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/XML/wsdldynamicurl.aspx</a></p>\n'}, {'answer_id': 5193, 'author': 'Chris Farmer', 'author_id': 404, 'author_profile': 'https://Stackoverflow.com/users/404', 'pm_score': 0, 'selected': False, 'text': '<p>If you mean a VS2005 "Web Reference", then the generated proxy classes have a URL property that is the SOAP endpoint url of that service.  You can change this property and have your subsequent http communications be made to that new endpoint.</p>\n\n<p>Edit:  Ah, thanks bcaff86.  I didn\'t know you could do that simply by changing a property.</p>\n'}]
['https://Stackoverflow.com/questions/5188', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/326/']