【发布时间】:2011-11-15 14:52:25
【问题描述】:
我有一个 Web 服务,它在我的项目中接收客户端地址指向的信息: http://Server/PaymentWCF/Service.svc?WSDL
ServiceClient client = new ServiceClient();
foreach (Record rc in ListOne)
{
client.RecordInsert(rc);
}
foreach (Record rc in ListTwo)
{
client.RecordInsert(rc);
}
client.Close();
有时我们会打开 ServiceClient 一段时间,因为我们有很多记录要处理。 (最多 3,000) 昨晚,我收到以下错误消息:
请求通道在 00:04:59.9374976 之后等待回复时超时。增加传递给 Request 调用的超时值或增加 Binding 上的 SendTimeout 值。分配给此操作的时间可能是较长超时的一部分。
但是,绑定在任何地方都没有 00:04:59 的任何值:
<wsHttpBinding>
<binding name="WSHttpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
如果我们每 1000 条记录打开和关闭一次连接,它会起作用吗?客户端不会超时,因为它不会长时间打开。当我们处理 1000-15000 条记录时,我们运行正常。但是当我们有超过 3,000 时,我们开始看到超时。
你建议我怎么做?
【问题讨论】:
-
“但是,绑定在任何地方都没有任何值 00:04:59” 超时是近似值,它会在某个地方设置为 5 分钟。跨度>
-
您如何托管此服务?我猜IIS?哪个版本?
-
另外,检查双方的配置设置 - 客户端和服务器端。
标签: c# asp.net wcf web-services visual-studio-2010