windows调用web service 时 超时处理:
2014-01-15 17:43
141 查看
参考:http://blog.csdn.net/jwdream2008/article/details/7359985
http://www.360doc.com/content/12/1220/12/1472642_255262324.shtml
一.服务器端设置
1、web.config配置,<system.web></system.web>里面增加:<httpRuntime maxRequestLength="10240" appRequestQueueLimit="100" useFullyQualifiedRedirectUrl="true" executionTimeout="1200" />
2、扩大代理类的超时限制,默认是90秒
YourWebService yws = new YourWebService();
yws.Timeout = 1200000; //20分钟
3、IIS属性-网站 连接超时时间 1200秒
二.客户端设置
1、修改 app.config 文件,添加如下代码:
<httpRuntime executionTimeout="600" />
请求执行超时时间为600秒(默认为110秒)
2、设置 Web services 的 Timeout 属性
对 XML Web services 的同步调用的超时(以毫秒为单位)。默认为 100000 毫秒。
lywSqCommon.sqsdData.GetData getData = new lywSqCommon.sqsdData.GetData();//GetData 为类名
getData.Timeout=700000;//单位为毫秒
指示 XML Web services 客户端等待同步 XML Web services 请求完成的时间(以毫秒计)。
提示:如果将 Timeout 属性设置为 Timeout.Infinite,则指示该请求无超时。即使 XML Web services 客户端可以将 Timeout 属性设置为无超时,Web 服务器仍可以在服务器端使请求超时。
系统将以上面两项设置的最小者作为操作超时的时间长度。
http://www.360doc.com/content/12/1220/12/1472642_255262324.shtml
一.服务器端设置
1、web.config配置,<system.web></system.web>里面增加:<httpRuntime maxRequestLength="10240" appRequestQueueLimit="100" useFullyQualifiedRedirectUrl="true" executionTimeout="1200" />
2、扩大代理类的超时限制,默认是90秒
YourWebService yws = new YourWebService();
yws.Timeout = 1200000; //20分钟
3、IIS属性-网站 连接超时时间 1200秒
二.客户端设置
1、修改 app.config 文件,添加如下代码:
<httpRuntime executionTimeout="600" />
请求执行超时时间为600秒(默认为110秒)
2、设置 Web services 的 Timeout 属性
对 XML Web services 的同步调用的超时(以毫秒为单位)。默认为 100000 毫秒。
lywSqCommon.sqsdData.GetData getData = new lywSqCommon.sqsdData.GetData();//GetData 为类名
getData.Timeout=700000;//单位为毫秒
指示 XML Web services 客户端等待同步 XML Web services 请求完成的时间(以毫秒计)。
提示:如果将 Timeout 属性设置为 Timeout.Infinite,则指示该请求无超时。即使 XML Web services 客户端可以将 Timeout 属性设置为无超时,Web 服务器仍可以在服务器端使请求超时。
系统将以上面两项设置的最小者作为操作超时的时间长度。
相关文章推荐
- 在ASP.NET Atlas中调用Web Service——处理错误,超时以及响应用户的取消操作
- 在ASP.NET Atlas中调用Web Service——处理错误,超时以及响应用户的取消操作
- 在ASP.NET Atlas中调用Web Service——处理错误,超时以及响应用户的取消操作
- WebService 调用超时处理
- Windows 多批处理间调用.
- C或C++调用Windows系统函数 实现延时 或 获取当前时间的处理
- php处理调用外部接口超时
- Windows下QT中用C++调用Python之二 - 编译BUG处理
- Windows 窗体控件中的多线程处理之:如何对 Windows 窗体控件进行线程安全调用
- 使用ASP.NET AJAX异步调用Web Service和页面中的类方法(2):处理异步调用中的异常
- 调用异步服务时的超时处理
- 在多线程环境下使用HttpWebRequest或者调用Web Service(连接报超时问题)
- Windows 多批处理间调用.
- windows下如何解决PHP调用的外部程序超时阻塞问题
- 使用Windows 计划任务调用bat档处理删除文件夹
- 调用其他系统http接口超时了,如何处理,方案汇总
- 调用异步服务时的超时处理
- 调用接口处理时间过长,前端访问超时解决方案
- Ajax程序:处理异步调用中的异常(在客户端调用Web Service代理时发生异常的处理办法)
- 在ASP.NETAtlas中调用WebService—处理错误,超时以及响应用户的取消操作