WCF RESTful Service      Interview Questions         WCF Bindings             WCF Tracing                              

Friday, May 3, 2013

WCF Service - Configuring Timeouts for Binding

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?


As WCF Service Binding defines all about how to communicate. It plays an important role in managing performance and security for the service. So, understanding timeouts 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.


Be social and share with others via:


.NET Jobs from Indeed
Reader of this article might also be interested in:

By Imran Abdul Ghani
Software Developer (Senior)
United Arab Emirates
Imran Abdul Ghani is working as Software Developer(Senior) with extensive knowledge in Web development technologies especially C#, ASP.NET, MVC, WCF, Web API, ADO.NET Entity Framework, jQuery etc. He has several years of experience in designing/developing enterprise level applications. He is Microsoft Certified Solution Developer for .NET (MCSD.NET) since 2005. You can reach his blogging at www.webdevelopmenthelp.net & www.topwcftutorials.net.

No comments:

Post a Comment