none
WCF time out issue RRS feed

  • Question

  • I have created a WCF . In the Web.Config of the WCF i have made the following thing 

     <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IPrint" closeTimeout="00:10:00"
              openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" />
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPrint"
            contract="IPrint" name="PrintService" />
        </client>
        <behaviors>

    In the Client code I have written :

     _client.Endpoint.Binding.OpenTimeout = new TimeSpan(0, 10, 0);

     _client.Endpoint.Binding.CloseTimeout = new TimeSpan(0, 10, 0);

        _client.Endpoint.Binding.SendTimeout = new TimeSpan(0, 10, 0);
         _client.Endpoint.Binding.ReceiveTimeout = new TimeSpan(0, 10, 0);

    But after doing the above thing I am getting the following error : 

    The HTTP request to 'http://<Server>/PrintService/Print.svc' has exceeded the allotted timeout. The time allotted to this operation may have been a portion of a longer timeout.

    Plz help me in this 

    Wednesday, April 15, 2015 9:21 AM

Answers

  • Hi ShreyPrasad,

    <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IPrint" closeTimeout="00:10:00"
              openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" />
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPrint"
            contract="IPrint" name="PrintService" />
        </client>
        <behaviors>

    Based on your description, I see that the above is your WCF Service web config, then you should configure the binding of a large timeout value for the service endpoint, please try to add the following in your WCF Service web config file:

    <services>
        <service name="***">     
          <endpoint address="" binding="basicHttpBinding" 
    bindingConfiguration="BasicHttpBinding_IPrint"
    contract="***"/> </service> </services>

    Besides, please also try to increase the executionTimeout value in your WCF Service web config as following:

    <httpRuntime executionTimeout="1000" />


    Best Regards,
    Amy Peng



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, April 16, 2015 2:32 AM
    Moderator