我有一个 .NET 4.0 集成模式下的 Web 应用程序,通过本地主机在同一服务器上调用 .NET 2.0 集成模式下的 Web 服务 (ASMX)。
十分之九的情况都工作正常,但偶尔 Web 应用程序会在调用期间出现“请求超时”和“线程被中止”错误。它在该代码示例的最后一行给出了错误:
Dim Service As New localhost.Service
Dim Input As New localhost.InputProduct
Dim Ret As New localhost.OutputProduct
Try
Ret = Service.RequestProduct(Input)
Catch
Finally
Service.Dispose()
If Ret.succesfull = True Then
If Response.IsClientConnected = True Then
Response.Redirect("success.aspx", False)
End If
End If
End Try
在 Web 服务的日志文件中,我得到 sc-win32-status: 995 和 sc-status: 200,通常所花费的时间总是略多于 60 秒(时间花费:62743) 。通常这需要 14 秒才能完成且没有错误。
单击按钮后,在 ASPX 页面的隐藏代码中进行调用。 页面上有一个Updatepanel,该按钮用作PostBackTrigger。
问题:为什么我在 Web 服务调用后收到这些“请求超时”错误?
服务器:
- Windows Server 2008 R2 SP1
- IIS 7.5
- 微软 UrlScan 3.1
- Windows 防火墙
最佳答案
我终于找到了这个问题的答案。原来是web.config中的这段代码:
<pages smartNavigation="true">
关闭此功能后,我不再收到任何超时错误。 超时的原因可能是 IE 浏览器中 smartNavigation 设置生成的 IFRAME(而不是 Firefox/Chrome)
我已在 .NET 2.0 中使用此设置 eliminating the flash caused by navigation ,升级到 .NET 4.0 后,Visual Studio 没有提供任何线索表明此设置已被弃用。
我找到了答案,因为我还有其他问题需要处理。使用最新的ajaxToolkit后对于 .NET 4.0,我在使用 AutoCompleteExtender 时在 IE7/8 中遇到了以下 javascript 警报错误:
Stack overflow at line: 0
这与 smartNavigation 设置有关。因此,删除此设置同时解决了两个问题。希望我能帮助别人解决这个问题,因为对我来说,这是我在互联网的短暂历史中发现的最烦人的错误之一。
关于web-services - IIS 7.5 抛出 sc-win32-status : 995 after 60 seconds on web service (ASMX) request,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13032748/