Web service error - Client found response content type of text/html...

Discussion in 'ASP .Net Web Services' started by Felix Wafytech, Nov 22, 2006.

  1. Hello,

    We've a webservice that calls a SQL 2000 stored procedure. This stored procedure takes a long time to run (approximately 4-5 minutes). This causes the webservice to return the below error:

    "Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'. "

    We identified this to be a time out error and increased the CommandTimeOut value and the webservice timeout value to 600000. Still the issue persists, what could be the reason? The same web service works correctly, when queried with a set of parameters that returns a lesser number of records or gets processed faster.

    One other question is, the webservice returns the above error in approximately 3 minutes. However, the timeout value is configured for 600000, which is 10 minutes. How could that be possible?

    Any help is very much appreciated.

    Thanks,
    Felix.J
    Felix Wafytech, Nov 22, 2006
    #1
    1. Advertising

  2. Hello Felix,

    From your description, you're calling an ASP.NET webservice that calls a
    SQL stored procedure in SQL 2000 db. However, since the stored procedure
    takes long time to run, you're getting timeout error at client-side proxy,
    correct?

    Based on my experience, for webservice call with database command
    execution, there are three timeout settings you can take care:

    1. The "executionTimeout" setting in ASP.NET application's <httpRuntime>
    web.config element. This will control the server-side ASP.NET worker
    thread's processing timeout period:

    #httpRuntime Element (ASP.NET Settings Schema)
    http://msdn2.microsoft.com/en-us/library/e1f13641.aspx

    BTW, to make sure this setting work, you need to set the <compilation
    debug="xxx" /> to false, because under debug setting, it will always use a
    fixed timeout period.

    2. The .net webservice client proxy also has a timeout which dervied from
    the "WebClientProtocol" class:

    #WebClientProtocol.Timeout Property
    http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.webcl
    ientprotocol.timeout.aspx


    3. If you're using SqlCommand or other command object to execute database
    query, it also has a CommandTimeout property which you can control the
    timeout period for waiting the execution command to finish:

    #SqlCommand.CommandTimeout Property
    http://msdn2.microsoft.com/en-gb/library/system.data.sqlclient.sqlcommand.co
    mmandtimeout(VS.80).aspx

    Please have a look at the above settings. If there is any other questions,
    please feel free to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================



    This posting is provided "AS IS" with no warranties, and confers no rights.
    Steven Cheng[MSFT], Nov 23, 2006
    #2
    1. Advertising

  3. Thanks Steven, setting the executionTimeout to a higher value seems to have
    solved this issue.

    - Felix.J

    "Steven Cheng[MSFT]" <> wrote in message
    news:62P%23Z%...
    > Hello Felix,
    >
    > From your description, you're calling an ASP.NET webservice that calls a
    > SQL stored procedure in SQL 2000 db. However, since the stored procedure
    > takes long time to run, you're getting timeout error at client-side proxy,
    > correct?
    >
    > Based on my experience, for webservice call with database command
    > execution, there are three timeout settings you can take care:
    >
    > 1. The "executionTimeout" setting in ASP.NET application's <httpRuntime>
    > web.config element. This will control the server-side ASP.NET worker
    > thread's processing timeout period:
    >
    > #httpRuntime Element (ASP.NET Settings Schema)
    > http://msdn2.microsoft.com/en-us/library/e1f13641.aspx
    >
    > BTW, to make sure this setting work, you need to set the <compilation
    > debug="xxx" /> to false, because under debug setting, it will always use

    a
    > fixed timeout period.
    >
    > 2. The .net webservice client proxy also has a timeout which dervied from
    > the "WebClientProtocol" class:
    >
    > #WebClientProtocol.Timeout Property
    >

    http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.webcl
    > ientprotocol.timeout.aspx
    >
    >
    > 3. If you're using SqlCommand or other command object to execute database
    > query, it also has a CommandTimeout property which you can control the
    > timeout period for waiting the execution command to finish:
    >
    > #SqlCommand.CommandTimeout Property
    >

    http://msdn2.microsoft.com/en-gb/library/system.data.sqlclient.sqlcommand.co
    > mmandtimeout(VS.80).aspx
    >
    > Please have a look at the above settings. If there is any other questions,
    > please feel free to post here.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    >

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no

    rights.
    >
    >
    >
    >
    Felix Wafytech, Nov 24, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Damon Payne
    Replies:
    0
    Views:
    9,173
    Damon Payne
    Mar 8, 2005
  2. Jesús Bosch
    Replies:
    1
    Views:
    13,079
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 3, 2006
  3. Guest
    Replies:
    0
    Views:
    125
    Guest
    Nov 14, 2003
  4. Søren M. Olesen
    Replies:
    4
    Views:
    539
    Dan Rogers
    Feb 15, 2005
  5. acssi
    Replies:
    0
    Views:
    331
    acssi
    Jan 16, 2007
Loading...

Share This Page