.netweb-serviceswsdl.exe

How to consume web service hosted on multiple servers, from different clients?


I am consuming web services in my client application.

At present, the proxy classes are generated using the wsdl.exe. The web class's URL property is set to specific URL where the web service is hosted. The proxy classes are part of one of the class library projects.

Now, we need to host the web service on more than one servers and different clients would point to different servers. How can i manage this now?

Do i need to generate proxies for different clients separately using the URL to which client would be pointing? If yes, then how can i use single setup for all clients?

I am using VS 2008.


Solution

  • As long as the wsdl is the same* for each service you don't need to generate different web service proxies - you can just use the same one and set the endpoint url on the proxy to be the url of the web service you wish to use.

    * - Apart from things like the published endpoint url and things like that.