0

I've written a WCF service and wonder if it somehow possible to not get the service part:

<wsdl:service name="MyService">
<wsdl:port name="BasicHttpBinding_MyService" binding="tns:BasicHttpBinding_MyService">
  <soap:address location="http://localhost:8000/MyService/Service" />
</wsdl:port>

generetad either directly in the wsdl or when svcutil pulls it down.

Or maybe it's easier to write a powershell script that just removes the service element?

Markus
  • 1,614
  • 1
  • 22
  • 32

2 Answers2

2

implement IWsdlExportExtension. Inside it remove the parts you do not want:

http://msdn.microsoft.com/en-us/library/system.servicemodel.description.iwsdlexportextension.aspx

Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
0

It is not possible to prevent the built-in metadata from emitting the service portion of the WSDL.

Your options are to create a new metadata behavior, or even simpler, to turn off the metadata and simply provide a handcrafted WSDL via a well known Url.

Ethan Cabiac
  • 4,943
  • 20
  • 36