A problem has recently been encountered with WCF: When a client sends a large amount of data to a WCF service, the discovery prompts:
"The maximum string content length quota (8192) is exceeded when reading XML data. You can increase this quota by changing the Maxstringcontentlength property of the XmlDictionaryReaderQuotas object that is used when you create the XML reader. "So the internet search, are said to modify the configuration can be, but I am a beginner, modified half a day has not come out, the final various integration, try, finally succeeded, so write down, for later need: Add the following code in the configuration file (only need to modify the server configuration file):
1. Under the <system.serviceModel> node, add:
<bindings>
<basicHttpBinding>
<binding name= "NEWBINDING0"Closetimeout=" 10:10:00 "opentimeout=" 10:10:00 "receivetimeout=" 10:10:00 "sendtimeout=" 10:10:00 " Bypassproxyonlocal= "false" hostnamecomparisonmode= "StrongWildcard" maxbuffersize= "2147483647" maxBufferPoolSize= " 2147483647 "maxreceivedmessagesize=" 2147483647 "messageencoding=" Text "textencoding=" Utf-8 "transfermode=" Streamed "usedefaultwebproxy=" true ">
<readerquotas maxdepth= "2147483647" maxstringcontentlength= "2147483647" maxarraylength= "2147483647" Maxbytesperread= "2147483647" maxnametablecharcount= "2147483647"/>
<security mode= "None" >
<transport clientcredentialtype= "None" proxycredentialtype= "None" realm= ""/>
<message clientcredentialtype= "UserName" algorithmsuite= "Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorconfiguration= "NewBehavior0"Name=" > "WcfService.GXSC.LoginService"
<endpoint binding= "BasicHttpBinding" contract= "WcfService.GXSC.ILoginService"/>
<baseAddresses>
<add baseaddress= "Http://localhost:1379/GXSC/LoginService.svc"/>
</baseAddresses>
</service>
<service behaviorconfiguration= "NewBehavior0"Name=" > "WcfService.GXSC.ShipInfoService"
<endpoint binding= "BasicHttpBinding" contract= "WcfService.GXSC.IShipInfoService"/>
<baseAddresses>
<add baseaddress= "Http://localhost:1379/GXSC/ShipInfoService.svc"/>
</baseAddresses>
</service>
</services>
Under the 2.<behaviors> <serviceBehaviors> node, add the following:
<behavior name= "NewBehavior0" >
<servicemetadata httpgetenabled= "true"/>
<datacontractserializer maxitemsinobjectgraph= "2147483647"/>
<servicethrottling maxconcurrentcalls= "maxconcurrentsessions=", "maxconcurrentinstances="/>
<servicedebug includeexceptiondetailinfaults= "true"/>
</behavior>
It's OK.
WCF client transfers big data to server failed configuration issues