title: Maximum request length exceeded in WCF
body: <p>I am currently using Wcf application and getting above mentiooned error in Trace Log.</p>
  
  <p>Below is the Web.Config for Wcf Service.</p>
  
  <pre><code>&lt;bindings&gt;
            &lt;wsHttpBinding&gt;
                &lt;binding name="NewBinding0" closeTimeout="00:50:00" openTimeout="00:50:00" sendTimeout="00:50:00" receiveTimeout="00:50:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647"&gt;
                    &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /&gt;
                    &lt;reliableSession enabled="true" /&gt;
                    &lt;security mode="None"&gt;
                        &lt;transport clientCredentialType="None" /&gt;
                        &lt;message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="false" /&gt;
                    &lt;/security&gt;
                &lt;/binding&gt;
            &lt;/wsHttpBinding&gt;
        &lt;/bindings&gt;       
  
  &lt;diagnostics wmiProviderEnabled="true"&gt;
    &lt;messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" /&gt;
  &lt;/diagnostics&gt;
  &lt;services&gt;
    &lt;service behaviorConfiguration="DBSyncWcfService.Service1Behavior" name="DBSyncWcfService.DBSyncService"&gt;
      &lt;endpoint binding="wsHttpBinding" bindingConfiguration="NewBinding0" name="ABC" contract="DBSyncWcfService.IDBSyncContract" address="http://192.168.5.170:9999/" /&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
  </code></pre>
  
  <p>
            
          
        
      
      </p>
  
  <p>Below is the Client side Configuration. </p>
  
  <pre><code>        WSHttpBinding binding = new WSHttpBinding();
          //binding.ReaderQuotas.MaxArrayLength = 10485760;
  
          //binding.MaxReceivedMessageSize = 10485760;
          binding.Security.Mode = SecurityMode.None;
          binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
          binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
          binding.Security.Message.EstablishSecurityContext = false;
          //binding.Security.Message.NegotiateServiceCredential = true;
          binding.ReliableSession.Enabled = true;
          binding.ReaderQuotas.MaxArrayLength = 2147483647;
          binding.ReaderQuotas.MaxDepth = 2147483647;
          binding.ReaderQuotas.MaxNameTableCharCount = 2147483647;
          binding.ReaderQuotas.MaxBytesPerRead = 2147483647;
          //binding.MaxReceivedMessageSize = 20000000;2147483647
          binding.MaxReceivedMessageSize = 2147483647;
          //binding.MaxReceivedMessageSize = Int32.MaxValue;
          binding.ReaderQuotas.MaxStringContentLength = 2147483647; 
  
          //binding.MaxBufferPoolSize = 20000000;
          binding.MaxBufferPoolSize = 2147483647;
  
          //binding.MaxBufferPoolSize = Int32.MaxValue;
          binding.ReaderQuotas.MaxArrayLength = 2147483647;
          binding.ReaderQuotas.MaxDepth = 2147483647;
          binding.SendTimeout = TimeSpan.FromMinutes(50);
          binding.CloseTimeout = TimeSpan.FromMinutes(50);
          binding.OpenTimeout = TimeSpan.FromMinutes(50);
          binding.ReceiveTimeout = TimeSpan.FromMinutes(50);
  </code></pre>