Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

WCF Timeout settings for sl2 RSS

4 replies

Last post Aug 24, 2009 10:06 AM by MoHassan

(0)
  • xsdf

    xsdf

    Member

    177 Points

    255 Posts

    WCF Timeout settings for sl2

    Aug 13, 2008 01:15 PM | LINK

    I have a project used Sl2+Asp.net+WCF

    When I call a async method to get some data from  WCF ,it will take a few mintues when the network bandwidth is  less than 50K/s .

    And it will throw a timeout exception . 

    My question is WCF have 4 timeout setting:

    OpenTimeOut,CloseTimeOut,ReceivedTimeout,SendTimeOut ,

    Which timeout I need set in my scenario  and do I need make these settings in both ServiceReferences.ClientConfig file and Web.config ???

    Thanks . 

     

     

     

     

    ************************************
    To be or not to be, it's not a question ,it's life.
  • Jonathan Shen – MSFT

    Jonathan She...

    All-Star

    50156 Points

    4951 Posts

    Microsoft

    Re: WCF Timeout settings for sl2

    Aug 15, 2008 07:32 AM | LINK

    Hi Xsdf,

    xsdf

    My question is WCF have 4 timeout setting:

    OpenTimeOut,CloseTimeOut,ReceivedTimeout,SendTimeOut ,

    OpenTimeOut:   Gets or sets the interval of time provided for a connection to open before the transport raises an exception. (Inherited from Binding.)

    CloseTimeOut:   Gets or sets the interval of time provided for a connection to close before the transport raises an exception. (Inherited from Binding.)

    ReceivedTimeout:  Gets or sets the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped. (Inherited from Binding.)

    SendTimeOut :   Gets or sets the interval of time provided for a write operation to complete before the transport raises an exception. (Inherited from Binding.)

     

    xsdf

    Which timeout I need set in my scenario  and do I need make these settings in both ServiceReferences.ClientConfig file and Web.config ???

    We suggest that you'd better set all these four to a bigger value in web.config.  For example,   http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.aspx

    Best regards,

    Jonathan

     

     

    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
  • xsdf

    xsdf

    Member

    177 Points

    255 Posts

    Re: WCF Timeout settings for sl2

    Aug 15, 2008 09:17 AM | LINK

    Very clear.

    I 've set four timeout in app configuration file .It works fine.

    Thanks.

    ************************************
    To be or not to be, it's not a question ,it's life.
  • bobbby

    bobbby

    Member

    53 Points

    184 Posts

    Re: Re: WCF Timeout settings for sl2

    Aug 24, 2009 09:59 AM | LINK

    hi mate, In which page we have to set this timeout ..u mean in app.xaml page ??

    thanks

    Bobby
  • MoHassan

    MoHassan

    Member

    467 Points

    151 Posts

    Re: Re: WCF Timeout settings for sl2

    Aug 24, 2009 10:06 AM | LINK

    Hi,

    You set them in your Web.Config file, it looks like below.

    <bindings>
        <!--
              Following is the expanded configuration section for a BasicHttpBinding.
              Each property is configured with the default value.
              See the TransportSecurity, and MessageSecurity samples in the
              Basic directory to learn how to configure these features.
              -->
        <basicHttpBinding>
          <binding name="Binding1"
                   hostNameComparisonMode="StrongWildcard"
                   receiveTimeout="00:10:00"
                   sendTimeout="00:10:00"
                   openTimeout="00:10:00"
                   closeTimeout="00:10:00"
                   maxReceivedMessageSize="65536"
                   maxBufferSize="65536"
                   maxBufferPoolSize="524288"
                   transferMode="Buffered"
                   messageEncoding="Text"
                   textEncoding="utf-8"
                   bypassProxyOnLocal="false"
                   useDefaultWebProxy="true" >
            <security mode="None" />
          </binding>
        </basicHttpBinding>
      </bindings>