I have a Web Application in .NET 4.0 Integrated mode calling a web service (ASMX) in .NET 2.0 Integrated mode on the same server via localhost.
9 out of 10 times all works fine, but occasionally the Web Application get's a "Request timed out" and "Thread was being aborted" error during the call. It gives the error on the last line of this code example:
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
In the log file of the web service I get a sc-win32-status: 995 and a sc-status: 200, typically the time-taken is always a little bit more than 60 seconds (time-take: 62743). Normally this would take 14 seconds to complete without errors.
The call is made in the code behind of the ASPX page after a button is clicked. On the page there is an Updatepanel and the button is used as a PostBackTrigger.
Question: Why do I get these "request timed out" error after the web service call?
Server:
- Windows Server 2008 R2 SP1
- IIS 7.5
- Microsoft UrlScan 3.1
- Windows Firewall
Consider changing httpRuntime executionTimeout = "xxx" tag located in the machine.config for your web server. The default may be two short for your situation. Value expressed in seconds consider doubling it.
I finally found the answer to this problem. It turned out to be this piece of code in the web.config:
After turning this off I didn't receive any time-out errors anymore. The reason for the time-out is probably the IFRAME that the smartNavigation setting generates in IE browsers (not in Firefox/Chrome)
I have used this setting in .NET 2.0 to eliminating the flash caused by navigation, after upgrading to .NET 4.0 Visual Studio didn't give any clue that this setting was deprecated.
I found the answer, because I had an other problem to deal with. After using the latest ajaxToolkit for .NET 4.0 I had this javascript alert error in IE7/8 while using the AutoCompleteExtender:
This turned out to be related to the smartNavigation setting. So removing this setting fixed two problems at once. Hopefully I help someone with this, because for me it was one of the most annoying error's I've found in the short history of internet.