title: how to increase MaxReceivedMessageSize when calling a WCF from C#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5459697/the-maximum-message-size-quota-for-incoming-messages-65536-has-been-exceeded">The maximum message size quota for incoming messages (65536) has been exceeded</a>  </p>
  </blockquote>
  
  
  
  <p>I am using WCF for file uploading and downloading. uploading is successful but when i downloading a large file i found this error</p>
  
  <blockquote>
    <p>Error : 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>My Service.config file has the following code.</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;compilation debug="true" /&gt;
      &lt;httpRuntime executionTimeout="4800" maxRequestLength="2147483647" /&gt;
  
  
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferPoolSize="524288"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="2147483647" 
              maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"  /&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
        &lt;!--&lt;webHttpBinding&gt;
          &lt;binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" /&gt;
        &lt;/webHttpBinding&gt;--&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="WITSService.WITSService"&gt;
          &lt;clear /&gt;
          &lt;endpoint binding="basicHttpBinding" contract="WITSService.WITSService" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
  
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceMetadata httpGetEnabled="true"/&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="myEndPointBehavior"&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
  
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>can any one help me how to increase MaxReceivedMessageSize </p>