我正在尝试使用nettcpbinding发布WCF服务。我希望发布元数据, 并使用 ?wsdl。我将以下行添加到配置文件中:
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
但是我无法在浏览器中看到wsdl。我做错了什么吗? 谢谢。
编辑:这是我配置文件中相关的部分:
<system.serviceModel>
<services>
<service name="wcfcheck.service1" behaviorConfiguration="wcfcheck.Service1Behavior">
<endpoint address="" binding="netTcpBinding" contract="wcfcheck.Iservice1"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="wcfcheck.Service1Behavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
我可能没有访问正确的URL。我尝试了http://localhost:51159/Service1.svc?wsdl和http://localhost:51159/Service1.svc/mex?wsdl,以及没有带“?wsdl”参数的URL。