locked
Web Service Timeout. RRS feed

  • Question

  • Greetings,

     

    I have been working on a project for sometime now that passes a large amount of string data from a client to a web service and returns results to the client.  The web service then contacts another web service that processes the string data.  The processing can take up to 5 minutes in some cases.  Business rules at our location prohibit clients from contacting the second web service directly.  The second web service was vendor written so my company does not have the ability to view the code for it.  What happens is with smaller batches, the data process correctly "sometimes".  Large batches fail nearly always.  We get the following error message:

     

    "Timeout Expired.  The timeout period elapsed prior to completion of the operation"

     

    Now I have been researching the timeout message and how to fix it for about 2 weeks.  I have tried increasing the timeouts on the proxy as well as the the the command timeout in the config files.  I have also tried tweaking IIS to increase it.  I am at an impass on how to solve this problem.

     

    Does anyone have any suggestions on what may be causing this?  Does anyone have any suggestions on identifying causes of errors such as these?  Any help or suggestion would be greatly valued.

     

    The web services are written in C# with the 1.1 framework.  Thank you in advance for any assistance you may be able to offer.

     

    Sincerely,

     

    Chris

     

     

    Monday, April 9, 2007 5:47 PM

Answers

  • First of all, where do you see the timeout occur?  Does the client timeout?  Does middle-tier web service timeout?  Does the call from the middle-tier to the vender web service timeout?

     

    For the web service calls, you set the timeout here:  http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.webclientprotocol.timeout(VS.71).aspx

     

    Have you tried setting this timeout on the client and the middle-tier to Timeout.Infinite?

     

    For the middle-tier web service you need to set the ASP.NET execution timeout here:  http://msdn2.microsoft.com/en-us/library/e1f13641.aspx

     

    Daniel Roth

    Monday, April 9, 2007 9:31 PM
  • Thank you for the advice Daniel.  I applied the suggestions to the web services and it was still timing out.  I started to think that maybe it wasn't the web services at all.  I did some profiling on the database and discovered that some of the data being submitted was exceeding the SQL server execution timeout.  We adjusted the timeout on the SQL server and streamlined some db code and it works like a pro now.

     

    Sometimes it takes a fresh persective to see things more clearly.  Thank you once again.

     

    Chris

    Wednesday, April 11, 2007 1:26 PM

All replies

  • First of all, where do you see the timeout occur?  Does the client timeout?  Does middle-tier web service timeout?  Does the call from the middle-tier to the vender web service timeout?

     

    For the web service calls, you set the timeout here:  http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.webclientprotocol.timeout(VS.71).aspx

     

    Have you tried setting this timeout on the client and the middle-tier to Timeout.Infinite?

     

    For the middle-tier web service you need to set the ASP.NET execution timeout here:  http://msdn2.microsoft.com/en-us/library/e1f13641.aspx

     

    Daniel Roth

    Monday, April 9, 2007 9:31 PM
  • Thank you for the advice Daniel.  I applied the suggestions to the web services and it was still timing out.  I started to think that maybe it wasn't the web services at all.  I did some profiling on the database and discovered that some of the data being submitted was exceeding the SQL server execution timeout.  We adjusted the timeout on the SQL server and streamlined some db code and it works like a pro now.

     

    Sometimes it takes a fresh persective to see things more clearly.  Thank you once again.

     

    Chris

    Wednesday, April 11, 2007 1:26 PM
  • I'm glad to hear you were able to resolve your issue!   Good luck with your work.

     

    Daniel Roth

    Wednesday, April 11, 2007 2:27 PM
  • Hi Daniel,

    I have been facing the similar issue. I have created a client application for a WCF webservice. I have added the wsdl as service reference.

    When I am trying to execute the method in the web service, I am getting a timeout error as the execution takes more than 6 min. The proxy class which is obtained from References.cs doesn't have "TimeOut" property.

    I tried adding below to app.config file.

      <system.web>
        <httpRuntime executionTimeout="356657" />
        <compilation debug="false"/>
      </system.web>

       <binding name="XXXX_Binding" receiveTimeout="00:10:00"
              sendTimeout="00:10:00" closeTimeout="00:10:00"  >

    None of them worked.

    Web service method is working fie with SOAP UI. But the proxy class obtained from references.cs is not being inherited from WebClientProtocol class. Hence it doesn't have TimeOut property.

    Could you please help me in resolving the issue?


    Thanks and Regards, Siva Kumar Balaguru

    Thursday, November 29, 2012 5:19 PM
  • I already moved your original question to Webservice client timeout.

    John Saunders
    WCF is Web Services. They are not two separate things.
    Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
    Use File->New Project to create Web Service Projects

    Thursday, November 29, 2012 8:17 PM
    Moderator