title: WCF message too big even with correct web.config
body: <p>I have a WCF service with the following web.config:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="MetadataExchange"&gt;
            &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="True"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="LargeHttpBinding" maxBufferSize="5064536" maxBufferPoolSize="5064536" maxReceivedMessageSize="5064536"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="5064536" maxArrayLength="5064536" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="MetadataExchange" name="Service.Interface.ApplicationService.ApplicationService"&gt;
          &lt;endpoint name="httpEndpoint" address="" binding="basicHttpBinding" bindingConfiguration="LargeHttpBinding" contract="Service.Proxy.ApplicationService.Interfaces.IApplicationService" /&gt;
          &lt;endpoint name="mexEndpoint" address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange"/&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:15000/"/&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;client&gt;
        &lt;endpoint name="httpEndpoint" address="http://localhost:15000/ApplicationService/ApplicationService.svc" binding="basicHttpBinding" bindingConfiguration="LargeHttpBinding" contract="Service.Proxy.ApplicationService.Interfaces.IApplicationService" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;!--ToDo: Set directory browse to false--&gt;
      &lt;directoryBrowse enabled="true"/&gt;
      &lt;validation validateIntegratedModeConfiguration="false"/&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The service should be able to receive 5MB+Overhead messages (I send pictures as byte arrays to the server).</p>
  
  <p>On the client side I use a ChannelFactory with the following BasicHttpBinding:</p>
  
  <pre><code>basicHttpBinding = new BasicHttpBinding();
  basicHttpBinding.MaxBufferSize = 5064536;
  basicHttpBinding.MaxBufferPoolSize = 5064536;
  basicHttpBinding.MaxReceivedMessageSize = 5064536;
  basicHttpBinding.ReaderQuotas.MaxDepth = 32;
  basicHttpBinding.ReaderQuotas.MaxStringContentLength = 5064536;
  basicHttpBinding.ReaderQuotas.MaxArrayLength = 5064536;
  basicHttpBinding.ReaderQuotas.MaxBytesPerRead = 4096;
  basicHttpBinding.ReaderQuotas.MaxNameTableCharCount = 16384;
  </code></pre>
  
  <p>If I try to send pictures with a size of about 150kb an error message is thrown with the following message:</p>
  
  <blockquote>
    <p>The remote server returned an unexpected response: (413) Request Entity Too Large.</p>
  </blockquote>