I have a WCF service that has REST and SOAP endpoints for every service. This was implemented similarly to this post: REST / SOAP endpoints for a WCF service with a configuration similar to the following:
<services>
<service name="TestService">
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
<endpoint address="soap" binding="basicHttpBinding" contract="ITestService"/>
<endpoint address="rest" binding="webHttpBinding" contract="ITestService"/>
</service>
</services>
The problem is that the REST endpoint shows up in the resulting WSDL as an additional port and binding.
Is there any way to prevent the REST endpoint from being included in the WSDL?
Found a decent way to do this using an
IWsdlExportExtension. There’s probably a more robust/reusable way to do this, but this solution requires the convention of all REST endpoints to be named “REST”. Below is the relevant part of an Endpoint behavior attached to all REST endpoints: