Wol*_*lf5 7 .net web-services timeout
我正在尝试记录客户端在Web服务调用上超时时发生的情况.
看看下面的HelloWorld代码.这是我想要做的,但似乎IsClientConnected无法正常工作,因为它总是返回true.
[WebMethod]
public string HelloWorld() {
//.. Do the Webservice stuff
if (!Context.Response.IsClientConnected) {
//Log some vital info about this call that timed out...
}
return "The WebService Result";
}
Run Code Online (Sandbox Code Playgroud)
有谁知道另一种检查Web服务调用状态的方法?
当客户端断开与Web服务调用的连接时,Web服务中不会抛出异常.代码继续运行,直到它完成,然后将其结果返回到虚无(当连接关闭时).
| 归档时间: |
|
| 查看次数: |
10268 次 |
| 最近记录: |