简体   繁体   English

超时异常-C#(wcf)

[英]Timeout exception - c# ( wcf )

While I'm executing the server method asynchronously, getting this Timeout exception continuously. 当我异步执行服务器方法时,不断收到此Timeout异常。

"Additional information: This request operation sent to http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous did not receive a reply within the configured timeout (00:01:00). “其他信息:发送到http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous的此请求操作在配置的超时(00:01:00)内未收到答复。
The time allotted to this operation may have been a portion of a longer timeout. 分配给该操作的时间可能是较长超时的一部分。
This may be because the service is still processing the operation or because the service was unable to send a reply message. 这可能是因为该服务仍在处理该操作,或者是因为该服务无法发送回复消息。
Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client." 请考虑增加操作超时(通过将通道/代理转换为IContextChannel并设置OperationTimeout属性),并确保该服务能够连接到客户端。”

Could someone mention how to increasing the operation timeout by casting the channel/proxy to IContextChannel and setting the OperationTimeout property ? 有人可以提到如何通过将通道/代理转换为IContextChannel并设置OperationTimeout属性来增加操作超时时间吗?

This is my existing binding (with client) code. 这是我现有的(与客户端)绑定代码。

    DuplexChannelFactory<IPortal> datafactory;
    NetTcpBinding tcpBinding = new NetTcpBinding();
    String sURL = "net.tcp://localhost:8002/MyPortal";              
    tcpBinding.MaxReceivedMessageSize = System.Int32.MaxValue;
    tcpBinding.ReaderQuotas.MaxArrayLength = System.Int32.MaxValue;
    datafactory = new DuplexChannelFactory<IPortal>(this,tcpBinding, sURL);               
    Portal = datafactory.CreateChannel();

If you follow the link in the error (schemas.microsoft.com etc etc) it serves up: 如果您点击错误中的链接(schemas.microsoft.com等),它将启动:

Theresource you are looking for has been removed, had its name changed, or is temporarily unavailable. 您要查找的资源已被删除,名称已更改或暂时不可用。

Why are you looking up MS? 为什么要查找MS? It sounds like you've got some config data wrong somewhere. 听起来您某处的配置数据有误。 If you search your source for that url, what do you find? 如果您在源中搜索该URL,会发现什么? Does it look sensible? 看起来明智吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM