سؤال

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?

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top