如何解决WCF在运行时更改超时服务器端
你好,我对wcf超时有一个疑问。
我将默认超时值设置为00:10:00分钟。
但是某些服务需要超过10:00分钟。所以我需要以编程方式在服务器端更改超时。
我试图进行更改,但找不到方法。有什么解决办法吗?
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="TCPBinding" portSharingEnabled="true" receiveTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" closeTimeout="00:10:00" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="None"/>
<reliableSession enabled="true" inactivityTimeout="00:10:00"/>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
Ver2
我尝试使用以下代码检查超时,但仍然没有改变。
OperationContext.Current.Channel.OperationTimeout
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。