1

I have a WCF service library containing two services. These two services share a common set of classes in their operations.

When I generate the WCF proxies with svcutil.exe, I get two sets of proxy classes (one for each service). Is there any way to have it only generate one set of these shared classes? Or will I have to partition these classes into separate namespaces?

jumpinjackie
  • 2,387
  • 4
  • 22
  • 26

1 Answers1

1

You can supply multiple service endpoint URI's to the svcutil.exe command line. When you specify more than one endpoint URI, any types that share a common schema will be generated once and reused amongst all service contracts.

http://msdn.microsoft.com/en-us/library/aa347733.aspx

jrista
  • 32,447
  • 15
  • 90
  • 130
  • Honestly not sure. I switched to using REST services for pretty much everything years ago, and haven't looked back. Classic SOAP/WSDL services are so heavy, bloated, and rigid I can't bring myself to use them unless I have absolutely zero options (which hasn't happened in years, thankfully.) – jrista Dec 12 '13 at 15:22
  • @DusanPlavak It does generate errors, but the common classes are in the output ... can't find anyway to stop the errors being reported though – SteveC Oct 08 '15 at 09:18