WCF DataService(OData)超时

时间:2014-06-06 09:38:28

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

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

1 个答案:

答案 0 :(得分:0)

您可以为closeTimeout中的wcf服务增加receiveTimeoutopenTimeoutsendTimeoutweb.config,例如:

<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