Search code examples
wcfwcf-bindingnet.tcp

WCF Service Help page for net.tcp binding


Is it possible to configure a WCF service (with net.tcp bindings) in such a way that it can display a help page as it shows in case of http bindings?


Solution

  • Add a mex endpoint to your service

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    

    Then add httpGetEnabled to the service's metadata

    <serviceBehaviors>
      <behavior name="MyServiceBehavior">
       <serviceMetadata httpGetEnabled="true"/>
      </behavior>
    </serviceBehaviors>
    

    Then you should be able to browse the mex endpoint's url with http

    EDIT: changed binding to mexHttpBinding instead of mexTcpBinding