Saturday, March 28, 2009

The maximum string content length quota (8192) has been exceeded.

Lets talk about the issue I encoutered few days ago.
While testing a WCF service, I encountered this strange error : -
"The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader."
After researching over the internet I found this solution, which I would like to share with everyone else here : -
<binding>
<netTcpBinding>
<binding name="TcpBinding" maxReceivedMessageSize="65530" maxBufferSize="65530">
<readerQuotas maxArrrayLength="32768" maxStringContentLength = "32768"/>
</binding>
<netTcpBinding>
<binding>