调用webservice 设置超时时间
2012-03-27 23:40
316 查看
1. 服务器端设置超时
在 web.config 的 system.web 里添加如下配置项:
< httpRuntime
executionTimeout="60"
/>
以上时间单位是秒.
记得要把 web.config 的 debug 模式关闭:
< compilation
defaultLanguage="c#"
debug="false"
/>
2. 客户端设置超时
在 WebService 的客户端代理程序(用 wsdl.exe 生成)里设置 Request 超时时间, 单位是毫秒:
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest wr = (HttpWebRequest)base.GetWebRequest( uri );
wr.Timeout = 30*1000;
return wr;
}
在 web.config 的 system.web 里添加如下配置项:
< httpRuntime
executionTimeout="60"
/>
以上时间单位是秒.
记得要把 web.config 的 debug 模式关闭:
< compilation
defaultLanguage="c#"
debug="false"
/>
2. 客户端设置超时
在 WebService 的客户端代理程序(用 wsdl.exe 生成)里设置 Request 超时时间, 单位是毫秒:
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest wr = (HttpWebRequest)base.GetWebRequest( uri );
wr.Timeout = 30*1000;
return wr;
}
相关文章推荐
- 【webservice】Axis2 客户端调用 设置超时时间
- cxf和HttpClient调用WebService,并设置超时时间
- Myeclipse调用webservice超时时间设置
- 调用webservice 设置超时时间
- 普元 EOS Platform 7.6 webservice图元调用服务,可以设置超时时间吗?有没有默认超时时间
- 客户端设置WebService调用超时时间
- C# 调用 Emgu.CV 显示RTSP流 + 设置程序运行超时时间
- VC中调用WebService的超时设置
- Apache HttpClient调用服务没有设置超时时间引起的血崩
- Axis2 客户端调用 设置超时时间
- CXF-WebService设置超时时间
- 设置调用方法的超时时间
- android 设置 webService 超时时间
- Python调用系统命令设置超时时间
- Axis2 客户端调用 设置超时时间
- webservice java客户端设置超时时间
- CXF调用webservice超时设置
- webservice java客户端设置超时时间
- Axis2 客户端调用 设置超时时间
- axis 2 调用响应超时时间设置