【发布时间】:2014-04-04 16:50:08
【问题描述】:
当我尝试从 wcf 服务返回大量数据时。返回时我遇到了崩溃。消息是“底层连接已关闭:连接已意外关闭。”。
我已阅读有关此问题的提示;他们不帮助我。我尝试增加绑定参数无济于事。我添加了一条痕迹,但它没有给我任何有用的信息。
我发现我可以毫无问题地准确返回 3274 条记录,但 3275 是一个问题。
我可以尝试分页,但这是最后的手段。
这是主程序中配置文件的关键部分
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="6553600" maxBufferPoolSize="524288" maxReceivedMessageSize="6553600"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
来自 wcf
<binding closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00"
sendTimeout="00:10:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="None" />
</binding>
【问题讨论】:
-
给定记录有多大?你可以发布你的配置文件吗?这可能是增加绑定限制但实际上并未使用绑定配置的情况。
-
如果可能,或许您可以同时提供客户端和服务器配置 sn-ps 以供审核。
标签: .net performance web-services wcf visual-studio-2012