The ERROR: sharepoint 2010 WCF : 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
Steps to set custom settings for large message support...
Some items to add based on my trials to get this to work with large messages:
First, to update the configuration for a custom WCF service -add a WebApplication level feature with nothing more then a feature receiver. The receiver should override "FeatureInstalled" as follows:
public override void FeatureInstalled(SPFeatureReceiverProperties properties) { SPWebService contentService = SPWebService.ContentService; SPWcfServiceSettings wcfServiceSettings = new SPWcfServiceSettings(); wcfServiceSettings.ReaderQuotasMaxStringContentLength = Int32.MaxValue; wcfServiceSettings.ReaderQuotasMaxArrayLength = Int32.MaxValue; wcfServiceSettings.ReaderQuotasMaxBytesPerRead = Int32.MaxValue; wcfServiceSettings.MaxReceivedMessageSize = Int32.MaxValue; contentService.WcfServiceSettings["mycustomservice.svc"] = wcfServiceSettings; contentService.Update(true); }
Obviously, the values listed above are the extreme cases and should be set according to what your service will need. Also, the key for the indexer used for the WcfServiceSettings collection is the name of your service file. If you place the file in a subdirectory -do not include the subdirectory name as part of the key. Thus, if your service is deployed to the ISAPI directory under:
/MyCompany/MyCustomService.svc
the key for the WcfServiceSettings collection would be:
mycustomservice.svc
CAUTION: The key, as stated above, is case sensitive. The key should be all lowercase.
More to Link :