WCF 传输大批量对象数组的问题
接口:bool UpdateRecursively(Entity[] listobj1, Entity[] listobj2);
当对象数组少的时候,可以正确调用,但是对象数组很大,就会报错:
An error occurred while receiving the HTTP response to http://localhost:11407/AutoDownload.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
但是我改配的都配置了,以下是我的配置:
client side:
<endpointBehaviors>
<behavior name="ClientdataBehavior">
<dataContractSerializer maxItemsInObjectGraph="6553600"/>
</behavior>
</endpointBehaviors>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="None"/>
</binding>
</wsHttpBinding>
</bindings>
service side:
<behaviors>
<serviceBehaviors>
<behavior name="metadataBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true"/>
<dataContractSerializer maxItemsInObjectGraph="6553600" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
我开启了wcf log,但是看log也看不出什么问题。
请大侠们看下,哪里有问题???
[解决办法]
maxItemsInObjectGraph =2147483647 也没用!
[解决办法]
可以先将数据格式化如xml再来传输
[解决办法]
把服务端和客户端的“<dataContractSerializer maxItemsInObjectGraph="6553600"/>
”改大些,如2147483646
[解决办法]
http://blog.csdn.net/fangxinggood/article/details/6031072