Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting SendTimeout in my WCF app.config

Little confused looking at my app.config, it looks like this:

<system.serviceModel>

<servcies>

    <service>

        <endpoint address="" binding="basicHttpBinding">
            <identity>
                           <dns value="localhost"
            </identity>
        <endpoint>

    </service>



</services>
<behaviors>
    <serviceBehaviors>

        <behavior>
            ...
        </behavior>

    </serviceBehaviors>
</beharviors>

</system.serviceModel>

Where exactly would I add my binding tag to set the SendTimeout value to larger than 1 minute?

like image 943
Blankman Avatar asked Nov 30 '22 20:11

Blankman


1 Answers

You set up a bindings section in your server's .config file like IceLava showed in your previous question:

  <bindings>
    <netTcpBinding>
    <binding name="longTimeoutBinding"
        receiveTimeout="00:10:00" sendTimeout="00:10:00">
      <security mode="None"/>
    </binding>
    </netTcpBinding>
   </bindings>

In your example above you could put it right under your behaviors.

Then, in your endpoint configuration you add a reference to that binding with the property bindingConfiguration = "longTimeoutBinding".

Something like this:

<endpoint address="" bindingConfiguration="longTimeoutBinding" binding="basicHttpBinding">
        <identity>
                   <dns value="localhost" />
        </identity>
<endpoint>

If you have the Programming WCF Services by Juval Lowy book you can see more on pages 28-29 (2nd Edition).

like image 189
Tad Donaghe Avatar answered Dec 04 '22 16:12

Tad Donaghe