1

Currently we connect to a WCF service. At the moment I'm getting intermittent CommunicationExceptions.

-> Exception (CommunicationException) System.ServiceModel.CommunicationException: Server returned an invalid SOAP Fault. Please see InnerException for more details. ---> 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.

I've already updated my config file to set the MaxStringContentLength to 2147483647

Still getting these errors intermittently.

Any suggestiong on what might be causing them?

Thanks in advance, Fiona

UPDATE The following is the binding from the config file:

<binding name="BasicHttpBinding_ServiceInterface" closeTimeout="00:01:00"
           openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
           allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
           maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
           messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
           useDefaultWebProxy="true">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
             maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="Message">
            <message clientCredentialType="Certificate"/>
          </security>
        </binding>

1 Answer 1

0

You also need to set Binding.MaxArrayLength,ReaderQuotas.MaxBytesPerRead to make it function properly.

2
  • Thanks DrakeVN. I should have mentioned in my original post that I updated the other Binding values also. Please see my update where i've now included my Binding
    – Fiona
    Jun 28, 2012 at 7:10
  • Do you have control on the service? Largely your client's config is fine, so I doubt that the service config may not be correct. Could you just create test method on the service and then return large blocks of data > 8192 bytes? I think that you should be able to replicate the exception. Jun 28, 2012 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.