【问题标题】:WCF Timeout ErrorWCF 超时错误
【发布时间】:2016-11-26 17:16:19
【问题描述】:

错误是:

请求通道在 00:00:59.9339962 之后等待回复时超时。增加传递给 Request 调用的超时值或增加 Binding 上的 SendTimeout 值。分配给此操作的时间可能是较长超时的一部分。

<system.serviceModel>
      <bindings>
        <basicHttpBinding>
          <binding name ="IncreaseTimeOut" sendTimeout ="00:25:00"></binding>
        </basicHttpBinding>
      </bindings>
        <behaviors>
            <serviceBehaviors>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="WCFServices.HelloService">
                <endpoint address="" binding="basicHttpBinding" contract="WCFServices.IHelloService">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
                <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                        <add baseAddress="http://localhost:8733/Design_Time_Addresses/WCFServices/HelloService/" />
                    </baseAddresses>
                </host>
            </service>
        </services>`enter code here
    </system.serviceModel>

【问题讨论】:

  • 您是真的在等待大约 60 秒,还是在发送请求后立即收到此异常消息?

标签: wcf


【解决方案1】:

您需要提供更多信息。 我假设有时在客户端您会收到超时。这可能是由很多原因造成的。这是一个例子:

1- 网络连接不良。

2- 防火墙阻止您的网站。

3- WCF 并发连接配置或最大连接限制。您可以像这样增加 web.config 中的连接限制:

<system.net>
<connectionManagement>
  <add address="*" maxconnection="500" />
</connectionManagement>

默认值为 2。有关更多信息,您可以阅读以下内容:scale up WCF service

【讨论】:

    猜你喜欢
    • 2010-12-14
    • 2015-06-02
    • 2011-05-23
    • 1970-01-01
    • 2011-01-28
    • 2013-06-21
    • 2011-06-16
    • 2011-04-22
    • 1970-01-01
    相关资源
    最近更新 更多