2013-02-14 69 views
1

我有一个网站,它连接到在负载平衡器&防火墙后面的两个应用程序服务器上部署在IIS中的WCF服务。当我使用HTTP端点时,网站能够成功连接到WCF服务。但是在切换到TCP协议时,我看到以下错误。WCF错误与TCP

更多的数据是预期的,但EOF已达到。

[InvalidDataException:更多的数据是意料之中的,但EOF达成]

[的ProtocolException:错误而读消息的流的位置0帧格式(状态:ReadingUpgradeRecord)]

[的ProtocolException:该服务器在net.tcp:///SecurityService.svc拒绝会话建立请求。]

网站应用程序池在本地用户帐户下运行,而WCF服务正在默认ApplicationPoolIdentity下运行。服务端没有生成跟踪日志。跟踪日志正在客户端生成,并具有相同的错误。

WCF服务托管在应用程序服务器的默认端口808下,但它不被任何其他应用程序/服务共享。 环境:Win2k8,IIS 7.5

我已验证从Web服务器到应用程序服务器的TCP连接,并没有问题。

请让我知道,如果有任何其他信息需要从我身边。真的很感谢任何指导,因为我在这方面花了很多时间。

从配置文件中的片段低于:

WCF服务

<bindings> 
     <netTcpBinding> 
     <binding name="NetTcpBinding_Configuration" closeTimeout="00:10:00" 
      openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
      transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" 
      hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" 
      maxBufferSize="2147483647" maxConnections="100" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <reliableSession ordered="true" inactivityTimeout="00:10:00" 
      enabled="false" /> 
      <security mode="None"/> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
<services> 
     <service name="<namespace>.ServiceImplementation.Security"> 
     <endpoint address="net.tcp://<servername>/SecurityService.svc" 
      binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Configuration" 
      contract="<namespace>.ServiceInterface.ServiceContracts.ISecurity" name="NetTcpBinding_Security"> 
      <identity> 
      <servicePrincipalName value="host/<servername>" /> 
      </identity> 
     </endpoint> 
     </service> 
    </services> 

网站客户端

<bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpBinding_Configuration" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 
     <netTcpBinding> 
     <binding name="NetTcpBinding_Configuration" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> 
      <security mode="None" /> 
     </binding> 
     </netTcpBinding> 
    </bindings> 
<client> 
     <endpoint address="http://<servername>/SecurityService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Configuration" contract="SecurityService.Security" name="BasicHttpBinding_Security" /> 
     <endpoint address="net.tcp://<servername>/SecurityService.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Configuration" contract="SecurityService.Security" name="NetTcpBinding_Security"> 
     <identity> 
      <servicePrincipalName value="host/<servername>" /> 
     </identity> 
     </endpoint> 
    </client> 

回答

0

如果我是你,我会Wireshark交通会从客户端到服务器。你只是想确保你的流量不会在一路上被阻塞。如果您可以确认情况并非如此,那么它必须是WCF服务配置问题。

在尝试调试WCF配置之前,尝试从图片中移除负载平衡器(如果可以的话),并直接点击WCF服务。大多数负载均衡器默认支持HTTP;但是对于任何其他协议将需要特殊配置。

+0

感谢您的建议。与基础设施团队一起验证,并且负载均衡器TCP配置似乎存在问题。修复后再检查一次。 – user2071704 2013-02-15 11:43:22