【发布时间】:2014-04-30 07:32:59
【问题描述】:
是否可以配置 WCF 服务(使用 net.tcp 绑定),使其可以在 http 绑定的情况下显示帮助页面?
【问题讨论】:
标签: wcf wcf-binding net.tcp
是否可以配置 WCF 服务(使用 net.tcp 绑定),使其可以在 http 绑定的情况下显示帮助页面?
【问题讨论】:
标签: wcf wcf-binding net.tcp
向您的服务添加一个 mex 端点
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
然后将 httpGetEnabled 添加到服务的元数据中
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
那么你应该可以用 http 浏览 mex 端点的 url
编辑:将绑定更改为 mexHttpBinding 而不是 mexTcpBinding
【讨论】: