setting a timeout when consuming a WS

Discussion in 'ASP .Net Web Services' started by GaryDean, Apr 28, 2007.

  1. GaryDean

    GaryDean Guest

    how can I deal with a web service that my not respond or my respond beyond
    my, say 30 second, tollerance?
    thanks
    Gary
    GaryDean, Apr 28, 2007
    #1
    1. Advertising

  2. GaryDean

    Manish Bafna Guest

    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
    --
    If my answer helped you,then please do press Yes below.
    Thanks and Regards.
    Manish Bafna.
    MCP and MCTS.



    "GaryDean" wrote:

    > how can I deal with a web service that my not respond or my respond beyond
    > my, say 30 second, tollerance?
    > thanks
    > Gary
    >
    >
    >
    >
    Manish Bafna, Apr 29, 2007
    #2
    1. Advertising

  3. 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.
    Steven Cheng[MSFT], Apr 30, 2007
    #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. Bob Johnson
    Replies:
    0
    Views:
    3,761
    Bob Johnson
    Aug 7, 2003
  2. Do
    Replies:
    2
    Views:
    6,364
  3. Guoqi Zheng
    Replies:
    4
    Views:
    13,023
    Guoqi Zheng
    Jun 3, 2004
  4. Grant Merwitz

    consuming webserver timeout issue

    Grant Merwitz, Oct 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,109
    Grant Merwitz
    Oct 3, 2005
  5. Mark Probert

    Timeout::timeout and Socket timeout

    Mark Probert, Oct 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    1,280
    Brian Candler
    Oct 6, 2004
Loading...

Share This Page