在WCF服务中增加查询超时

时间:2018-04-16 11:35:08

标签: asp.net sql-server web-services wcf

我有一个非常冗长的SQL查询,执行时最多需要2分钟。我在我的WCF服务中使用了这个查询,它给出了这个例外 Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding。将此代码添加到我的Web配置文件

后无法解决
<system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding openTimeout="00:10:00"
             closeTimeout="00:10:00"
             sendTimeout="00:10:00"
             receiveTimeout="00:10:00">
    </binding>
  </wsHttpBinding>
</bindings>


<services>
  <service name="longTimeoutService"
    behaviorConfiguration="longTimeoutBehavior">
    <endpoint address="net.tcp://localhost/longtimeout/"
      binding="netTcpBinding" bindingConfiguration="longTimeoutBinding" />
  </service>
</services>

我该如何处理这个问题请指导我。感谢

0 个答案:

没有答案