0

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?

Ravi
  • 95
  • 1
  • 1
  • 8

1 Answers1

1

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

stombeur
  • 2,704
  • 22
  • 45
  • but that too didn't displayed the help page (which enlists all the operation contracts). Like, if http://localhost:8080/Service.svc is url for service, then hit on http://localhost:8080/Service.svc/help is throwing the error "resource not found" – Ravi Apr 30 '14 at 08:54
  • the suffix of the url is not help, but mex, as specified in the endpoint address – stombeur Apr 30 '14 at 09:00
  • hit on localhost:8080/Service.svc/mex?wsdl also throws "The resource cannot be found." – Ravi Apr 30 '14 at 09:00
  • did you change the binding to mexHttpbinding? – stombeur Apr 30 '14 at 09:00
  • Yes. After changing the binding to mexHttpBinding no error message is there. But its a blank page. No listing of operation contracts! – Ravi Apr 30 '14 at 09:03
  • Finally localhost:8080/Service.svc?wsdl is displaying some info in xml format. Thanks Stephane! – Ravi Apr 30 '14 at 09:12