setting a timeout when consuming a WS

G

GaryDean

how can I deal with a web service that my not respond or my respond beyond
my, say 30 second, tollerance?
thanks
Gary
 
M

Manish Bafna

Hi,
i would suggest instaed of increasing time-out you should try to figure
what is causing time-out.If it is database levek that is causing time-out
then try to optimize the query by using appropriate index,returning fewer
records etc.All said and still it is causing time-out then there are five
places where you can increase time-out:
[1]In the connection string you can add connection time out(in seconds)
[2]You can set command time out for command object
[3]You can set timeout property of proxy class of web service.
webservice1 ws = new webservice1;
ws.Timeout = 90000;//in millisecods
[4]You can set executionTimeout in web.config of webservice project
<executionTimeout="90"/>//in seconds
[5]You can set executionTimeout in web.config of ASP.NET Client Application
or app.config of windows client application(that is web service consumer)
<executionTimeout="90"/>//in seconds
You need to figure out increasing time-out in which one of these will solve
your problem
 
S

Steven Cheng[MSFT]

Hi Gary,

As Manish suggested, you can first check the service to measure an expected
and reasonable timeout period. For configuration ASP.NET webservice time,
there have two settings:

1. For server-side timeout, you can adjust the "executionTimeout" through
the <httpRuntime> element in web.config file.

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

BTW, you'd better use "release" mode since this setting is not used when
you use debugging mode at development time.

2.For client webservice proxy, you can also set the "Timeout" on it so as
to control the blocking time of your webservice client proxy:

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

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.
 

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

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top