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

Posted on 2007-07-25
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
    LVL 22

    Expert Comment

    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

    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

    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

    Check out this page .. it has a lot of references to timeout values and sounds similar to your problems ...
    LVL 1

    Assisted Solution

    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

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    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…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now