WCF Service , Request or increase the SendTimeout value on the Binding

10,355

able to fix my problem after reading this link.

Avoiding Problems with the Using Statement http://msdn.microsoft.com/en-us/library/aa355056.aspx

The C# "using" statement results in a call to Dispose(). This is the same as Close(), which may throw exceptions when a network error occurs. Because the call to Dispose() happens implicitly at the closing brace of the "using" block, this source of exceptions is likely to go unnoticed both by people writing the code and reading the code. This represents a potential source of application errors.

Share:
10,355
Nick Kahn
Author by

Nick Kahn

Updated on June 26, 2022

Comments

  • Nick Kahn
    Nick Kahn almost 2 years

    i having this problem randomly and i able to add/delete/update using the WCFServiceClient and then i get the error and its happening randomly...

    below is the client code that i am using...

    using(WCFServiceClient client = new WCFServiceClient ()) 
    { 
         //More codes here 
         Employee emp = new Employee()
         emp = client.GetEmployeeDataById(123); //<<<ERROR    
    }
    

    I increase the timeout to two minutes but still the same:

    <binding name="WSHttpBinding_IEmployeeService" maxReceivedMessageSize="200000" sendTimeout="00:02:00" >
    

    //error:

    The request channel timed out while waiting for a reply after 00:00:59.9990000. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

    any help? i have seen many posts but none them seems any fix or any guidance.