【发布时间】:2014-07-18 09:35:10
【问题描述】:
我有一个 WCF 服务和一个应用程序。
我的应用程序这样调用 wcf 服务:
string endpointAddress = "https:\\mywebsite.com\myservice\service.svc;
WSHttpBinding binding = new WSHttpBinding();
binding.MaxReceivedMessageSize = 524288000;
binding.CloseTimeout = new TimeSpan(0, 0, 20);
EndpointAddress endPointAddress = new EndpointAddress(address);
ChannelFactory<T> client = new ChannelFactory<T>(binding, endPointAddress);
IClientChannel proxy = (IClientChannel)client.CreateChannel();
我的服务的 web.config 文件内容如下:
<wsHttpBinding>
<binding name="Secure" maxReceivedMessageSize="10485760" openTimeout="00:10:00" sendTimeout="00:30:00" closeTimeout="00:10:00">
<readerQuotas maxDepth="10485760" maxStringContentLength="10485760" maxArrayLength="10485760" maxBytesPerRead="10485760" maxNameTableCharCount="10485760" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
但我的服务调用在 30 秒后超时。 为什么我的服务调用不使用 Web.config 超时?如果始终使用客户端设置,那么进行 web.config 设置的原因是什么?以及我需要设置哪个 Timeout 属性来停止我的服务调用在 30 秒后超时?
【问题讨论】: