Search code examples
web-servicesweb-applicationswsdl

Twitching Consumption of Web Services from Web Site to Web Application


I am trying to consume multiple Web Services that redefine some of the same common classes in their wsdl. I currently have them referenced in a Web Site, but I want to convert to Web Application.

Since some of the same classes are redefined from multiple Web Service, the problem is that when adding them in a web Application there is no way to make the namespaces the same across multiple Web Services, like you can in a Web Site.

Is there any way to do what I am looking for?


Solution

  • Show all files in your project, then hand-edit the autogenerated Reference.cs files to change the namespaces (and remove duplicates)? Ugly, but it ought to work.

    Alternatively, use wsdl.exe from the command line -- it can generate a single proxy for multiple services -- and then add the generated file to the project manually. The syntax is something like: wsdl http://svr/foo.asmx http://svr/bar.asmx /namespace:Fnord.Proxies