title: WCF Service Configuration for basicHttpBinding
body: <p>I am having an issue where I have SOA with a web site consuming services and a web site hosting services.  One of my services accepts an image (byte[]).  When I pass an image of 83kb to the WCF service I get the following error:</p>
  
  <p><em>The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.</em> </p>
  
  <p>There is no specific config in my server side configuration for this service.  The following is in my consuming web application web.config file:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
            &lt;binding name="BasicHttpBinding_ISchoolSettings" 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="false"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="998192" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt;
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="http://localhost:50977/Interface/Schools.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISchoolSettings" contract="Services.Schools.ISchoolSettings" name="BasicHttpBinding_ISchoolSettings" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>It looks like .net is ignoring the fact I've set <code>MaxArrayLength=2147483647</code> for this binding configuration.  </p>
  
  <p>I am using <code>.net 4.0</code> here.  Curiously, I have a machine with <code>.net 4.5</code> on it and I DONT get this error on that machine!!</p>
  
  <p>I've tried all sorts but cant seem to get around this issue.  </p>