Help! Explicit timeouts not being honored on Web Services on Vista Ultimate, IIS7

Posted on 2007-07-25
Medium Priority
Last Modified: 2012-06-27
I've been struggling with this issue for quite some time, and cannot seem to find the right solution.

I have two classic ASP.NET applications, one of the applications hosts a bunch of web services.  The other consumes the web services.  One of the methods requires a long time to execute and runs synchronously.

On IIS7 and Vista Ultimate only (works on XP and Server 2003 w/ IIS6), the connection to the web service timesout.  I've explictly set the executionTimeout on the httpRuntime element in the web.config to 3200 (1 hour). and in the instatiation of the proxy for the web service itself I set the timeout to infinity (i've tried 1 hour as well, with no luck).

Each time I try to execute a method that takes longer the 110 seconds, the connection to the web service times out.  Anyone have any suggestions about what steps that I could take to resolve this, other that redesign the system to execute the web service asynchronously.

One thing to note, if I use the ASP.NET development web server which is part of Visual Studio 2005, the timeout issue disappears, and everything works fine.  So I'm convinced this is specifically an issue with IIS7.  I have to run on Windows Vista, as the web service interfaces with a remote compiler which needs the Vista API to link with as well as side by side assembly support, which leaves Orcas and Windows 2008 out for now.
Question by:jklo
  • 3
LVL 22

Expert Comment

ID: 19576915
it could be a client side timeout waiting for the response as oppsed to the web server that is timeing out and terminating the session ... see if there are any paramters that you can set on the requesting side.

Author Comment

ID: 19577578
The only client side timeout is that in the instantion of the Proxy object:

public static void ConfigureProxy(SoapHttpClientProtocol proxy)
           if (proxy == null)
                      throw new ArgumentNullException("proxy", "The SoapHttpClientProtocol parameter 'proxy' can not be null in a call to ProxyUtil.SetNetworkCredential()");

           // Add a NetworkCredential instance to CredentialCache.
           // Negotiate for NTLM or Kerberos authentication.
           CredentialCache cache = new CredentialCache();
           cache.Add(new Uri(proxy.Url), "Negotiate", new NetworkCredential(USERNAME, PASSWORD, DOMAIN));

           //configure the proxy with the credential cache, suggest pre-auth, and set the timeout to one hour
           proxy.Credentials = cache;
           proxy.PreAuthenticate = true;

            proxy.Timeout = System.Threading.Timeout.Infinite;

It's clearly not the client itself timing out as the client application is able to catch the exception and display it. If the client were timing out, I would suspect an error that I wouldn't be able to catch on the client side, except through some external module.
LVL 22

Accepted Solution

cj_1969 earned 1000 total points
ID: 19591514
The timeout you reference ... System.Threading.Timeout ... appears to be an internal timeout and not the piece of code that is doing the communication.  If something is timeing out it would be the main piece of code that handles the communication with the remote host ... and it HAS to have a timeout function or people would be endlessly hanging all of their client applications due to servers that are unavailable or unreachable.

I agree, it is quite possible that the time out is an expertnal module, something at a much higher level than the code you are writing ... but I would expect that there is still a configuration file SOMEWHERE that can be modified to adjust the value.

As an example (not that this is the peoblem) but if youlook atht e cache.add ... one of the paramters is "Negotiate" ... this implies a communication which would inherintly have a timeout associated with it.
LVL 22

Expert Comment

ID: 19591537
Check out this page .. it has a lot of references to timeout values and sounds similar to your problems ... http://forums.asp.net/p/1101560/1807061.aspx 

Assisted Solution

nsomnac earned 1000 total points
ID: 19594839
If you look at the code snippet above, I'm setting the Timeout property of an SoapHttpClientProtocol object to Infinite using the constant defined in System.Threading.Timeout.Infinite.

When you invoke a web service, you instantiate a proxy.  You set the timeout on the proxy object.

In my web.config within the <system.web> element all timeouts are set to 1 hour:
     <sessionState mode="InProc" stateConnectionString="tcpip=" sqlConnectionString="data source=;Trusted_Connection=yes"
      cookieless="false" timeout="3600" />

     <!-- 1 GB and 1 Hour -->
     <httpRuntime maxRequestLength="1048576" executionTimeout="7200" />

As well within the Application Pool, Under Process Model, Idle Timeout (minutes) is set to 60, Ping enabled is set to False, Ping Max Response Time (sec) is set to 3200, Shutdown Time Limit is set to 3200 seconds, and Startup Time Limit is set to 3200 seconds. Process Orphaning is disabled, Rapid Fail Protection is disabled, Recycling is set to 2 hours.

If I run the web service using the ASP.NET 2.0 Development webserver.  Everything works.  As soon as I try running the web services under IIS 7, then thats when I have the timeout problem.  So I'm convinced it's an issue within the Web Service Application, whether it be the application or the IIS 7 config.  I'm more on the belief that it's a Config problem or an actual bug as IIS 7 is *technically* still beta even though it ships with *production* Vista.

So any other thoughts?  I'


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question