简单问题:
如何在客户端项目中自行托管netTcpBinding服务,右键单击服务引用>添加服务参考...
单击“发现”,它使用WsHttpBinding引用所有服务,包括netTcpBinding。但是当扩展netTcpBinding时,它无法导航到合同并且它会抛出以下错误:
无法找到与scheme net.tcp匹配的基地址 绑定MetadataExchangeTcpBinding的端点。注册基地 地址方案是[http]。
我发现以下.Net WCF示例非常好,但是在示例中,它没有显示配置文件的设置方式,以及我们如何通过wizzard获取代理。
C:\ WF_WCF_Samples \ WCF \基本\绑定\净\的Tcp \默认\ CS
这是服务配置文件...(我不使用任何基地址,它应该在没有它的情况下工作我认为)
<service behaviorConfiguration="Canopus.WebServices.LogAndNotificationService"
name="Canopus.WebServices.LogAndNotificationService">
<endpoint address="" binding="netTcpBinding"
contract="Canopus.WebServices.ILogAndNotificationService" />
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
</service>
<behaviors>
<serviceBehaviors>
<behavior name="Canopus.WebServices.LogAndNotificationService">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
感谢您的帮助!
答案 0 :(得分:0)
我认为当您处理netTcPBinding时,您的服务行为不能具有httpGetEnabled属性。并且看起来你的终点地址包含像http://它应该是net.tcp://。