5

在我的代码中,我向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措辞。

如果我的请求甚至没有得到服务器的响应,为什么它是“服务器”?

4

1 回答 1

0

连接的两端都可能发生超时;客户端或服务器。因此,根据您的例外情况,我会说客户端连接到服务器,但由于没有及时生成响应(基于服务器对 的绑定sendTimeout),WCF 响应如您所见。

有关超时设置的更多信息,请参阅http://msdn.microsoft.com/en-us/library/hh924831(v=vs.110).aspx 。

于 2014-02-23T22:51:02.677 回答