简体   繁体   English

增加请求超时asp.net和WCF服务

[英]Increase Request timeout asp.net and WCF Service

I have an ASP.net application which calls a WCF service to retrieve Data from SQL Server. 我有一个ASP.net应用程序,该应用程序调用WCF服务以从SQL Server检索数据。

There is a function which has to wait the WCF to Select some rows from over 1 million records. 有一个功能必须等待WCF从超过一百万条记录中选择一些行。 This function causes my ASP application to generate a Request timeout error. 此函数使我的ASP应用程序生成请求超时错误。 I used the following lines to increase the timeout but it did not work, I cannot edit the IIS config file. 我使用以下几行来增加超时时间,但是它没有用,我无法编辑IIS配置文件。

<system.web>
    <httpRuntime targetFramework="4.5.1" executionTimeout="500" />
</system.web>

I believe timeouts that you are looking for are in binding configuration. 我相信您正在寻找的超时是在绑定配置中。 If you get your data from wcf service then look for your endpoint config and configure binding for it. 如果从wcf服务获取数据,请查找端点配置并为其配置绑定。 look below: 往下看:

<configuration>
  <system.serviceModel>
   <bindings>
    <basicHttpBinding>
     <binding openTimeout="00:10:00" 
             closeTimeout="00:10:00" 
             sendTimeout="00:10:00" 
             receiveTimeout="00:10:00">
    </binding>
   </basicHttpBinding>
  </bindings>
 </system.serviceModel>
</configuration>

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

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