We are trying to send a large xml string to a service method in WCF, and we get an error
The maximum length of the quota string content (8192) was exceeded reading XML data.
The error implies an increase in maxstringcontentlength , although we were not sure that we should do this on the client side or on the server side, or both. We tried using both, but we still seem to get the error. I am going to publish the client and service configuration below. I assume there is a problem with one or both of them so that this does not work.
Any suggestions?
Customer:
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_ITESTService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <client> <endpoint name="BasicHttpBinding_ITESTService" address="http://localhost/TESTService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ITESTService" contract="TESTService.ITESTService" /> </client> </system.serviceModel>
Server:
<system.serviceModel> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_Service1" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /> <security mode="None" /> </binding> </basicHttpBinding> </bindings> <services> <service name="TESTService"> <endpoint name="BasicHttpBinding_Service1" address="http://localhost/TESTService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Service1" contract="ITESTService" /> </service> </services> <behaviors> <serviceBehaviors> <behavior> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel>
source share