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

F

Felix Wafytech

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
 
S

Steven Cheng[MSFT]

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.
 
F

Felix Wafytech

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

- Felix.J
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top