我已经使用 mysql DB 创建了 wcf datatservices。我正在快速从表中获取数据。但是当我尝试从 View 获取数据时,它抛出超时异常。当直接在数据库中尝试时,数据变得非常快。
我尝试在 web.config 中设置以下内容。
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetHttpBinding" maxBufferPoolSize="2147483647" closeTimeout="00:01:00"
openTimeout="00:01:00" maxConnections="10"
receiveTimeout="00:10:00"
sendTimeout="00:10:00"
maxBufferSize="524288" maxReceivedMessageSize="2147483647" />
</netTcpBinding>
</bindings>
<services>
<service name="MyService">
<endpoint address="http://localhost:59825" binding="netTcpBinding"
bindingConfiguration="NetHttpBinding" name="HttpBinding" />
</service>
</services>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
仍然超时异常。
编辑1:
当我尝试使用表格时,数据正在获取。我创建了一个 View ,从同一个表中选择*。现在它也抛出超时异常。
请帮忙。
谢谢, 萨里莎。
最佳答案
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="longTimeoutBinding"
receiveTimeout="00:10:00" sendTimeout="00:10:00">
<security mode="None"/>
</binding>
</netTcpBinding>
</bindings>
<services>
<service name ="longTimeoutService"
behaviorConfiguration="longTimeoutBehavior">
<endpoint address="net.tcp://localhost/longtimeout/"
binding="netTcpBinding" bindingConfiguration="longTimeoutBinding">
</endpoint>
</service>
....
编辑:
如果您没有收到,请访问此链接: Explaination of different timeout types
关于c# - WCF数据服务-从mysql查看超时过期问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17964317/