调用 WebServices 时偶尔出错
我有一个 ClickOnce 应用程序,它调用服务器上的 WebServices(标准 ASMX 样式,而不是 WCF)。有时,用户会收到此错误:
System.Reflection.TargetInitationException: 运算过程中出现异常,导致结果无效。 检查 InnerException 以获取异常详细信息。
System.Net.WebException:无法连接到远程服务器 System.Net.Sockets.SocketException:已对已发出的连接请求 连接的套接字
这种情况很少发生(每天近百万次调用中出现 10-20 次),但仍然足以让用户偶尔抱怨一次。
服务器是带有 IIS 的标准 Windows 2003 R2。
这里可能有什么问题?
I have a ClickOnce app that calls WebServices on the server (standard ASMX style, not WCF). Occasionally, the users get this error:
System.Reflection.TargetInvocationException:
An exception occurred during the operation, making the result invalid.
Check InnerException for exception details.System.Net.WebException: Unable to connect to the remote server
System.Net.Sockets.SocketException: A connect request was made on an already
connected socket
This occurs fairly rarely (10-20 times a day out of nearly a million calls), but still enough that users complain about it once in a while.
The server is a standard Windows 2003 R2 with IIS.
What could be the issue here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要检查是否在调用周围实现了Using语句,客户端仅处理六个线程,这可能会导致Web服务拒绝调用。
如果这不起作用,您可能需要考虑通过 aync 调用 Web 服务。
干杯
You may want to check that you implenting the a Using Statement around your call, there client handles only six threads out, this could cause the webservice to refuse the call.
If this does not work, you may want to think about calling the webservice via aync.
Cheers