WCF Service – Configuring Timeouts for Binding

By | May 3, 2013


As we already know that a WCF Service endpoint has ABC (Address, Binding and Contract).Address means “Where to find the service?”
Binding means “How to communicate with service?”
Contract defines “What to communicate?
AsWCF Service Binding defines all about how to communicate. It plays an important role in managing performance and security for the service. So, understandingtimeouts configuration values on binding will definitely have impact on performance, usability as well as security.Few days back, one of my colleague was facing an issue of inactivity timeout on a WCF service. We spend sometime looking into configuration and find out that “ReceiveTimeout” value on binding was set to a very short value.So, In order to resolve the issue, we just increase this timeout value to something bigger and reasonable as shown below. For the purpose of sharing, I am writing this WCF Service Tutorial.

<bindings>
        <netTcpBinding>
            <binding receiveTimeout=”00:30:00″………>
            </binding>
        </netTcpBinding>
    </bindings>

“ReceiveTimeout” value on binding actually defines how long a session will remain idle before timing out.

Various timeout values on binding are listed below and we can find its detail here:

  1. OpenTimeout
  2. CloseTimeout
  3. SendTimeout
  4. ReceiveTimeout
Going through these configuration in detail will definitely improve performance and security for WCF Service.

Other Related Articles:

Top 10 Interview Questions and Answers Series: