Maximum String Content Length quota error when consuming WCF webservice from Biztalk

TygerKrash picture TygerKrash · Apr 16, 2010 · Viewed 8k times · Source

I'm getting this error message ...

"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"

... in the one of my orchestrations that consumes a WCF webservice (stacktrace indicates the receive shape is where the issue is). It is likely that the response is very large.

Looking at some of the other questions with this error message, the solution is to change a WCF bindings setting in the configuration file. However I can't find these configuration settings when I'm using BizTalk. They don't seem to be generated anywhere, should I be trying to add them to BTSNTSVc.exe.config ?

Any suggestions welcome.

Answer

Tanner picture Tanner · Apr 16, 2010

Do you have control over the server side code? If so, change the config there and regenerate the service reference. Should look something like maxStringContentLength="2147483647":

<bindings>
  <wsHttpBinding>
    <binding name="newHTTPBinding" 
             maxBufferPoolSize="2147483647"  
             maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="32" 
                    maxStringContentLength="2147483647"
                    maxArrayLength="16384" 
                    maxBytesPerRead="4096" 
                    maxNameTableCharCount="16384" />
    <binding/>
  <wsHttpBinding>
<bindings>