簡體   English   中英

當客戶端甚至無法連接到WCF服務器時,為什么會出現“服務器堆棧跟蹤”的異常?

[英]Why do I get an exception with “server stack trace” when the client can't even connect to WCF server?

在我的代碼中,我向https://端點發出WCF請求。 有時WCF服務器無論出於何種原因都無法訪問,然后我的代碼將產生和異常:

System.TimeoutException
The request channel timed out while waiting for a reply after 00:01:00.
Increase the timeout value passed to the call to Request or increase
the SendTimeout value on the Binding. The time allotted to this operation
may have been a portion of a longer timeout.

和異常的.StackTrace包含以下文本:

Server stack trace: <<<< THE QUESTION IS ABOUT THIS VERY LINE
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at [my code here invoking an OperatiionContract-attributed method

.InnerException是另一個TimeoutException帶有以下消息:

The HTTP request to 'https://management.core.windows.net/subscription-id-here/
   services/hostedservices/service-name-here/deployments/deployment-id-here'
has exceeded the allotted timeout of 00:01:00. The time allotted to this
operation may have been a portion of a longer timeout.

我沒有得到的是Server stack trace措辭。

如果我的請求甚至沒有被服務器響應,為什么它是“服務器”?

連接的兩端都可能發生超時; 客戶端或服務器。 因此,基於您的異常,我會說客戶端連接到服務器但由於沒有及時生成響應(基於服務器對sendTimeout的綁定),WCF會按您所見的方式響應。

有關超時設置的更多信息,請參見http://msdn.microsoft.com/en-us/library/hh924831(v=vs.110).aspx

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM