Search code examples
visual-studio-2008web-servicesproxy-classes

Change WebService Proxy URL in Visual Studio .NET 2008


I've created a WebService Proxy from a given URL, but at runtime a need to change this URL depending of some conditions.

How to do it?

I've searched on the web and founded that I should change the "Url" property. But, some how, this property isn't exposed in my proxy class.

I am using Visual Studio .NET 2008


Solution

  • If you are talking about the "classic" SOAP web service proxy (created like this: http://alexduggleby.com/2008/08/24/add-web-reference-instead-of-service-reference-in-visual-studio-2008/), it really has an URL property.

    If you are using Service references as in "new" WCF web services, take a look at this SO post: How to consume WCF web service through URL at run time?