【问题标题】:Increasing timeout WCF calling ASMX增加超时 WCF 调用 ASMX
【发布时间】:2013-11-29 15:53:08
【问题描述】:

我有一个使用 asmx Web 服务的 WCF 服务。对 Web 服务的调用有时会超时。如何增加超时值,最好是在 webconfig 中。

谢谢

【问题讨论】:

    标签: c# asp.net wcf asmx


    【解决方案1】:

    您应该能够在 web.config 中调整执行超时。

    HttpRuntimeSection.ExecutionTimeout

    ExecutionTimeout 属性指示请求在被 ASP.NET 自动关闭之前允许执行的最大秒数。默认值为 110 秒。仅当元素中的 debug 属性设置为 false 时,此超时才适用。

    <configuration>
        <system.web>
          <compilation debug="false" targetFramework="4.5" />
          <httpRuntime targetFramework="4.5" executionTimeout="60"/>
        </system.web>
    </configuration>
    

    【讨论】:

    • 谢谢 - 澄清一下,我的 WCF webconfig 中有这个,它会改变 WCF 和 ASMX 之间的超时时间?
    • 对于使用 ASMX Web 服务的 WCF 客户端,我相信您需要调整会话超时。 link
    • 您还可以在客户端 congif 文件中调整绑定的接收超时时间。
    【解决方案2】:

    你应该在你的 Web.config 里面试试这个...

    1) &lt;system.web&gt;

    <httpRuntime targetFramework="4.5.2" maxRequestLength="4194304" maxQueryStringLength="2048" executionTimeout="360" />
    

    2)&lt;basicHttpBinding&gt;

    <binding name="uploadFilesBasicHttpBinding" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="00:10:10" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00">
    

    【讨论】:

      猜你喜欢
      • 2018-04-06
      • 1970-01-01
      • 2010-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-30
      • 2011-12-10
      • 1970-01-01
      相关资源
      最近更新 更多