【问题标题】:WCF DataService (OData) TimeoutWCF 数据服务 (OData) 超时
【发布时间】:2014-06-06 09:38:28
【问题描述】:

有一个 WCF DataService(OData) 开发并部署为使用实体框架访问 SQL Azure 数据库的 azure webrole。
它适用于行数较少的表。
但也有一些表有数百万行。尝试访问时,发生超时。
有没有办法避免超时?

【问题讨论】:

    标签: wcf odata wcf-data-services azure-web-roles


    【解决方案1】:

    您可以在web.config 中为 wcf 服务增加 closeTimeout、receiveTimeout、openTimeout 和 sendTimeout,例如:

    <basicHttpBinding>
          <binding name="BasicHttpBinding_IManagementService" closeTimeout="00:10:00"
            openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="2147483647" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
            <readerQuotas maxDepth="128" maxStringContentLength="2147483647"
              maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
            <security mode="None">
              <transport clientCredentialType="None" proxyCredentialType="None"
                realm="" />
              <message clientCredentialType="UserName" algorithmSuite="Default" />
            </security>
          </binding>
        </basicHttpBinding>
    

    更多详情请参考:Configuring Timeout Values on a Binding

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-17
      • 2011-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多