<p>This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below</p>

<pre><code>************** Exception Text **************
System.ServiceModel.CommunicationException: Error in deserializing body of reply message for operation 'GetFilingTreeXML'. ---&gt; System.InvalidOperationException: There is an error in XML document (1, 9201). ---&gt; System.Xml.XmlException: 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. Line 1, position 9201.
at System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3)
at System.Xml.XmlExceptionHelper.ThrowMaxStringContentLengthExceeded(XmlDictionaryReader reader, Int32 maxStringContentLength)
at System.Xml.XmlDictionaryReader.ReadString(Int32 maxStringContentLength)
at System.Xml.XmlDictionaryReader.ReadString()
at System.Xml.XmlBaseReader.ReadElementString()
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderImageServerClientInterfaceSoap.Read10_GetFilingTreeXMLResponse()
at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer9.Deserialize(XmlSerializationReader reader)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)
--- End of inner exception stack trace ---
</code></pre>

<p>I did a search and the results are below:
<a href="http://search.yahoo.com/search?p=This+quota+may+be+increased+by+changing+the+MaxStringContentLength+property+on+the+XmlDictionaryReaderQuotas+object+used+when+creating+the+XML+reader." rel="nofollow noreferrer">Search Results</a></p>

<p>Most of those are WCF related but were enough to point me in the right direction. I will post answer as reply.</p>

[{'answer_id': 65499, 'author': 'MikeScott8', 'author_id': 1889, 'author_profile': 'https://Stackoverflow.com/users/1889', 'pm_score': 3, 'selected': False, 'text': '<p><a href="http://joewirtley.blogspot.com/2007/08/maximum-string-content-length-and.html" rel="nofollow noreferrer">Jow Wirtley\'s blog post</a> pointed me in the right direction.</p>\n\n<p>All I had to do was update the bindings in the app.config of the client app and it all works now.</p>\n'}, {'answer_id': 65511, 'author': 'Darrel Miller', 'author_id': 6819, 'author_profile': 'https://Stackoverflow.com/users/6819', 'pm_score': 6, 'selected': True, 'text': '<p>Try this blog post <a href="https://web.archive.org/web/20210128000850/http://geekswithblogs.net/niemguy/archive/2007/12/11/wcf-maxstringcontentlength-maxbuffersize-and-maxreceivedmessagesize.aspx" rel="nofollow noreferrer">here</a>.  You can modify the MaxStringContentLength property in the Binding configuration.</p>\n'}]
['https://Stackoverflow.com/questions/65452', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1889/']