我在接收对象列表的 Web 引用上调用服务List<T>
它可以很好地列出最多大约 13000 个的列表,但是当列表的长度超过 13000 并且调用该服务时,它会引发以下错误:
底层连接是关闭:接收时发生意外错误。
我也有一个非常相似的错误(底层连接已关闭:连接意外关闭。)在接收字符串并返回一长串对象(如您在此处看到)的服务上,我已经解决了web.config,但它不能解决接收列表作为参数的服务的错误,它只能用于能够返回长的对象列表
我在绑定中有这个:
<binding name="customBasicHttp" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00"
sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="67108864" maxBufferPoolSize="67108864"
maxReceivedMessageSize="67108864" messageEncoding="Text"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="67108864"
maxArrayLength="67108864" maxBytesPerRead="5242880"
maxNameTableCharCount="67108864" />
<security mode="None" />
</binding>
这在行为中:
<behavior name="EndpointBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
我需要能够将一长串对象作为参数发送到 Web 参考中的服务