title: WCF : How to Set MaxReceivedMessageSize Quota
body: <p>I have a WCF Service. I get the following message when I run the client application </p>
  
  <blockquote>
    <p>The maximum message size quota for incoming messages (65536) has been
    exceeded. To increase the quota, use the MaxReceivedMessageSize
    property on the appropriate binding element.</p>
  </blockquote>
  
  <p>Also i added MaxReceivedMessageSize property in related config in client and server projects.</p>
  
  <p>My config in client application is :</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="RPBasicHttpBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000"&gt;
            &lt;readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="http://localhost:40003/PersonWcfService.svc/PersonServices"
          binding="basicHttpBinding"
          contract="RP.Common.ServiceContract.IPersonService" name="BasicHttpBinding_IPersonService"&gt;
          &lt;identity&gt;
            &lt;dns value="localhost" /&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>My config in WCF project is :</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="RP.WcfService.PersonWcfService" behaviorConfiguration="RP.WcfServiceBehaviour"&gt;
          &lt;endpoint address="PersonServices" binding="basicHttpBinding" bindingConfiguration="RPBasicHttpEndpointBinding" contract="RP.Common.ServiceContract.IPersonService" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name="RP.WcfServiceBehaviour"&gt;
          &lt;serviceMetadata httpGetEnabled="true" /&gt;
          &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="RPBasicHttpEndpointBinding" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000"&gt;
            &lt;readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Where other is then i should set MaxReceivedMessageSize property to increase message size quota?</p>