IIS 7.5 / WCF - net.tcp状态未知 [英] IIS 7.5 / WCF - net.tcp status unknown
问题描述
我正在尝试使用 netTcpBinding
而不是 wsHttpBinding
来使用我的WCF服务,但我不能似乎让它工作。
I'm trying to get my WCF service working with netTcpBinding
instead of wsHttpBinding
, but I can't seem to get it working.
我添加了 net.tcp
绑定到IIS7.5,但状态为未知(当我也删除了http绑定时,它会在网站上放置一个大的红色X,我必须在我再次访问任何设置之前添加一个新的http绑定)。我已经看过这里和谷歌,但我只能在没有任何真正解决方案的情况下找到关于这个问题的两三篇帖子。
I added the net.tcp
binding to IIS7.5 but the status is Unknown (and when I also remove the http binding it puts a big red X through the site and I have to add a new http binding before I can access any settings again). I already looked here and on Google but I could only find two or three posts about this issue without any true solutions.
我有什么:
- WAS服务正在运行,还有Net。*服务。
- 在IIS的高级设置中添加了net.tcp。
- 安装了WCF非http。
似乎有一个TCP侦听器正在运行,因为它在netstat中显示它正在侦听我指定的端口:809)并且我还有防火墙消息(也尝试过禁用防火墙/防病毒,但它没有帮助)。
There seems to be a TCP listener running, as it shows in netstat that it is listening on my specified port: 809) and I also got firewall message (also tried disabling the firewall/antivirus, but it didn't help).
WCF测试客户端导致此错误:
WCF Test Client results in this error:
错误:无法获取元数据来自net.tcp:// localhost:809 / MyService.svc
Error: Cannot obtain Metadata from net.tcp://localhost:809/MyService.svc
我的Web.config(主要是从MSDN复制的,用于正确布局看这里 http://pastebin.com/Ru8p0T9N ):
My Web.config (as copied mostly from MSDN, for proper layout look here 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中尝试了多个来自多个来源的不同设置,但我最后遇到了同样的问题。
Everything works fine with wsHttpBinding
but not with net.tcp
. I tried several different settings in the Web.config from multiple sources but I keep ending up with the same problem.
推荐答案
对于人们有同样的问题:正如我之前所说的,我将应用程序池更改为Classic并且它不起作用(http也不再起作用),但是当我将其更改回来并且回收应用程序池时它突然起作用。
For people having the same problem: As I said before, I changed the Application Pool to Classic and it didn't work (http also didn't work anymore), but when I changed it back and recycled application pool it suddenly worked.
这篇关于IIS 7.5 / WCF - net.tcp状态未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!