Showing posts with label type. Show all posts
Showing posts with label type. Show all posts

Multiple web service references sharing types


To share types between more web service references, generate proxy classes manual with the wsdl.exe (for example in a Visual Studio command prompt) like this:

wsdl /sharetypes WebServiceURL1 WebServiceURL2 ... WebServiceURLn
/o:OutputFileName.cs /n:NamespaceName

Just add this .cs file to your project and use the generated namespace's classes, you should't add any web reference. The types which are the same on more web services will be generated only once to a common namespace. This is very useful, because you needn't copy a lot of properties...

Posted on 22:05 by csharper and filed under , , , , , | 1 Comments »