我使用SoapHttpClientProtocol向web服务发送请求。有时我会遇到SocketException:“阻塞操作被WSACancelBlockingCall的调用中断”。我看到下面的调用堆栈:
System.IO.IOException: Unable to read data from the transport connection: A
blocking operation was interrupted by a call to WSACancelBlockingCall. --->
System.Net.Sockets.SocketException: A blocking operation was interrupted by a call to WSACancelBlockingCall
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
...
System.Net.WebException: The operation has timed out
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)我只给SoapHttpClientProtocol.Invoke打电话,其他什么也没打。如果机器有代理和防火墙,我就会遇到这个问题。我认为这可能是原因,但我不明白如何以及如何解决它。
发布于 2018-03-02 00:34:41
尝试使用以下命令增加超时
System.Web.Services.Protocols.SoapHttpClientProtocol.Timeout
在你打电话之前。
如果这不起作用,那么你可能需要查看防火墙设置,假设它从未通过防火墙工作。
https://stackoverflow.com/questions/49051614
复制相似问题