是否可以覆盖 .NET 客户端调用 Web 服务的默认超时?
我希望 Web 服务代理类等待 2 分钟以上
I'd like the web service proxy class to wait more than 2 minutes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我希望 Web 服务代理类等待 2 分钟以上
I'd like the web service proxy class to wait more than 2 minutes
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
需要考虑两件事 - 是的,TheSoftwareJedi 关于在代理上设置超时属性的做法是正确的 - 很简单。 默认值为 100 秒。
您还必须意识到 IIS 也将具有超时设置,并且如果达到超时设置,它将覆盖 C# 设置。 IIS 默认为 120 秒。
因此,在代理上设置超时属性将使您在开始达到 IIS 超时之前多等待 20 秒。
Two things to think about - yes, TheSoftwareJedi is correct about setting the Timeout property on the proxy - easy enough. The default value for that is 100s.
You also have to realize that IIS will have a timeout setting as well and it will override the c# setting if its reached. The IIS default is 120s.
So, setting the timeout property on the proxy will get you an additional 20s before you start hitting the IIS timeout.
只需设置超时属性 在代理上
Just set the timeout property on the proxy