title: WCF Service Error 413 Entity Too Large
body: <p>Need some insight on where to look further related to a WCF error I am getting about the Request Entity Too Large (Error 413).</p>
  
  <p>Pretty much, the service is a simple [OperationContract] accepting a string as a parameter.</p>
  
  <pre><code>&lt;IService.cs&gt;
  [OperationContract]
  string UploadReportText(string ReportText);
  
  
  &lt;Service.cs&gt;
  public string UploadReportText(string ReportText)
  {
    // Code to process data passed.
  }
  </code></pre>
  
  <p>I've already set the web config for the service as follows:</p>
  
  <pre><code>&lt;bindings&gt;
   &lt;webHttpBinding&gt;
      &lt;binding maxReceivedMessageSize="2147483647"&gt;
        &lt;readerQuotas maxDepth="2147483647"
                      maxStringContentLength="2147483647"
                      maxArrayLength="2147483647"
                      maxBytesPerRead="2147483647"
                      maxNameTableCharCount="2147483647" /&gt;
     &lt;/binding&gt;
   &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>Although I believe the uploadReadAhead value in IIS needs not be touched (as I am not using SSL), I still modified it to have a value of 2147483647.</p>
  
  <p>Tracing one of the apps that call the service in Chrome, I can see that the data Content-Length is 169786.</p>
  
  <p>Really stumped where to look further related to this.</p>
  
  <p>Appreciate any insight. Thanks</p>
  
  <p>Update: 
  Additional Info
  If I set the string data being passed to the service to a smaller length, I am not getting an error. Most of the search I did related to this all points to the maxReceivedMessageSize needs to be adjusted to the maximum possible value, but setting it in the web config seems to have no effect.</p>
  
  <p><strong>Update:</strong>
  Enabled logging and I got this message:</p>
  
  <p>Exception details: <code>System.ServiceModel.ProtocolException: 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.</code></p>