我正在尝试让我的 WCF 服务与netTcpBinding
代替wsHttpBinding
,但我似乎无法让它工作。
我添加了net.tcp
绑定到 IIS7.5 但状态为未知 (当我还删除 http 绑定时,它会在网站上放置一个大红色 X,我必须添加一个新的 http 绑定,然后才能再次访问任何设置)。我已经在这里和谷歌上查看过,但我只能找到两三个关于这个问题的帖子,没有任何真正的解决方案。
我拥有的:
- WAS 服务正在运行,还有 Net.* 服务。
- 在IIS的高级设置中添加了net.tcp。
- 安装了 WCF 非 http。
似乎有一个 TCP 侦听器正在运行,正如它在 netstat 中显示的那样,它正在侦听我指定的端口:809),并且我还收到了防火墙消息(也尝试禁用防火墙/防病毒软件,但没有帮助).
WCF 测试客户端导致此错误:
错误:无法从 net.tcp://localhost:809/MyService.svc 获取元数据
我的 Web.config(大部分是从 MSDN 复制的,为了正确的布局,请看这里http://pastebin.com/Ru8p0T9N http://pastebin.com/Ru8p0T9N):
<services>
<service behaviorConfiguration="MyBehavior" name="WCFService.MyService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="Binding1" name="MyServiceEndpoint" contract="WCFService.MyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MyServiceMexTcpBidingEndpoint" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:809/MyService.svc" />
</baseAddresses>
</host>
</service>
</services>
<behavior name="MyBehavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<netTcpBinding>
<binding name="Binding1"hostNameComparisonMode="StrongWildcard"sendTimeout="00:10:00"maxReceivedMessageSize="65536"transferMode="Buffered"portSharingEnabled="true">
<security mode="Message">
<transport clientCredentialType="None" />
<message clientCredentialType="None" />
</security>
</binding>
</netTcpBinding>
一切正常wsHttpBinding
但不与net.tcp
。我在 Web.config 中从多个来源尝试了几种不同的设置,但最终还是遇到同样的问题。
您是否将 net.tcp 添加为 IIS 中的启用协议?管理网站 => 高级设置 => 启用协议(逗号分隔)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)