Most of the issues discussed on the Internet about how to transmit a large amount of data through WCF are maxcompute edmessagesize = "2147483647" maxbufferpoolsize = "2147483647" maxbuffersize = "2147483647 ".
I have also set these settings, but when I debug WCF today, when I use an account to perform all operations OK. However, an error is reported when I use another account.
"The maximum number of projects in the object graph that can be serialized or deserialized is" 65536 ". Please change the object graph or increase the maxitemsinobjectgraph quota ".
Finally, I checked the database and found that there were only a few hundred data records in the previous account, and there were more than data records in the other account, which must have exploded.
Next, if you set maxitemsinobjectgraph on the server and client
WCF server configuration file
<system.serviceModel> <services> <service behaviorConfiguration="BasicServiceBehavior" name="XXX.WCF.Product"> <endpoint address="" binding="customBinding" bindingConfiguration="CompressionChannel" contract="XXX.WCF.IProduct"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <extensions> <bindingElementExtensions> <add type="WcfExtensions.ServiceModel.Configuration.CompressionElement,WcfExtensions.ServiceModel" name="compression"/> </bindingElementExtensions> </extensions> <bindings> <customBinding> <binding name="CompressionChannel" receiveTimeout="01:00:00" sendTimeout="01:00:00" > <compression/> <textMessageEncoding> <readerQuotas maxDepth="1024" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" /> </textMessageEncoding>
Client configuration file
<system.serviceModel> <extensions> <bindingElementExtensions> <add type="WcfExtensions.ServiceModel.Configuration.CompressionElement,WcfExtensions.ServiceModel" name="compression"/> </bindingElementExtensions> </extensions> <bindings> <customBinding> <binding name="CompressionChannel" > <compression/> <textMessageEncoding> <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"/> </textMessageEncoding>
In this way, you can increase the maximum transmission Volume After configuring the server and client.