繁体   English   中英

在我的WCF app.config中设置SendTimeout

[英]Setting SendTimeout in my WCF app.config

看着我的app.config有点困惑,它看起来像这样:

<system.serviceModel>

<servcies>

    <service>

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

    </service>



</services>
<behaviors>
    <serviceBehaviors>

        <behavior>
            ...
        </behavior>

    </serviceBehaviors>
</beharviors>

</system.serviceModel>

我究竟会在哪里添加我的绑定标记以将SendTimeout值设置为大于1分钟?

您在服务器的.config文件中设置了一个绑定部分,如上一个问题中显示的IceLava:

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

在上面的示例中,您可以将其置于行为之下。

然后,在端点配置中,使用属性bindingConfiguration =“longTimeoutBinding”添加对该绑定的引用。

像这样的东西:

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

如果您有Juval Lowy的编程WCF服务,请参阅第28-29页(第2版)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM