2011-03-24 81 views
5

我正在使用Windows身份驗證在WAS中託管的wcf net tcp服務。該服務始終因特定客戶端計算機的特定用戶憑據而失敗。憑證可以在另一臺客戶機上運行。客戶機上有不同的憑據。然而,服務的連續失敗,下面使用特定客戶機和證書錯誤:WCF System.TimeoutException:00:00:00後套接字傳輸超時

System.TimeoutException: The open operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout. ---> System.TimeoutException: The socket transfer timed out after 00:00:00. You have exceeded the timeout set on your binding. The time allotted to this operation may have been a portion of a longer timeout. ---> System.IO.IOException: The write operation failed, see inner exception. ---> System.TimeoutException: The socket transfer timed out after 00:00:00. You have exceeded the timeout set on your binding. The time allotted to this operation may have been a portion of a longer timeout. 
    at System.ServiceModel.Channels.SocketConnection.SetWriteTimeout(TimeSpan timeout, Boolean synchronous) 
    at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout) 
    at System.ServiceModel.Channels.BufferedConnection.WriteNow(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, BufferManager bufferManager) 
    at System.ServiceModel.Channels.BufferedConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout) 
    at System.ServiceModel.Channels.ConnectionStream.Write(Byte[] buffer, Int32 offset, Int32 count) 
    at System.Net.Security.NegotiateStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) 
    at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) 
    --- End of inner exception stack trace --- 
    at System.Net.Security.NegotiateStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest) 
    at System.Net.Security.NegotiateStream.Write(Byte[] buffer, Int32 offset, Int32 count) 
    at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout) 
    --- End of inner exception stack trace --- 
    at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout) 
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper) 
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper) 
    at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) 
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) 
    --- End of inner exception stack trace --- 

Server stack trace: 
    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade) 
    at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

注意超時是00:00:00後,即使它配置爲00:01:00。這導致我相信它實際上不是超時問題。以下是我的綁定:

  <netTcpBinding> 
     <binding name="NetTcpBinding_IMyAwesomeService" 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="2147483647" 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="Transport"> 
      <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" /> 
      <!--<extendedProtectionPolicy policyEnforcement="Never" />--> 
      <message clientCredentialType="Windows" /> 
      </security> 
     </binding> 
     </netTcpBinding> 

我現在正在設置E2E跟蹤,並在獲得結果後回發。

回答

1

您在異常中看到的超時值表示在超時之前還剩多少操作時間。所以,以上可能肯定會在超時時間內解決問題。在綁定中配置的超時時間很短,似乎需要超過1分鐘。您可以嘗試增加超時值,很可能是打開的超時值。

HTH 阿米特

+0

嗨阿米特,感謝您的答覆。我將切換超時值,但正如我注意到的,它在0秒後超時。這次電話會花費不到一秒鐘的時間完成,所以我不知道如何花費一分多鐘時間。 – Noel 2011-03-24 22:18:25

+0

另外,你爲什麼說這是手術時間?它看起來像是對我開放的時間......? – Noel 2011-03-24 22:54:05

+0

對不起,我的壞...我只是想指出如何超時記錄在例外消息的概念。我不確定你的意思是「它在0秒後超時」,你看到請求在一秒之內失敗嗎? – amit 2011-03-25 19:24:23