title: Javascript to WCF - MaxStringContentLength Exception
body: <p>I am using a jQuery/JavaScript client to send in AJAX request to WCF REST service (webHttpEndpoint) and I am getting the following exception...</p>
  
  <p>System.Xml.XmlException: The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader.</p>
  
  <p>Here is my system.serviceModel web.config definition...</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"
                                 multipleSiteBindingsEnabled="true" /&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="MembershipBinding"&gt;
            &lt;security mode="TransportWithMessageCredential"&gt;
              &lt;message clientCredentialType="UserName" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
          &lt;binding name="userHttps"&gt;
            &lt;security mode="Transport" /&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="CommonSvcBehavior"&gt;
            &lt;serviceCredentials&gt;
              &lt;userNameAuthentication userNamePasswordValidationMode="MembershipProvider"
                                      membershipProviderName="AspNetSqlMembershipProvider" /&gt;
            &lt;/serviceCredentials&gt;
            &lt;serviceAuthorization principalPermissionMode="UseAspNetRoles"
                                  roleProviderName="MySqlRoleProvider" /&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
          &lt;behavior name="AuthenticationServiceTypeBehaviors"&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
          &lt;/behavior&gt;
          &lt;behavior name=""&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;standardEndpoints&gt;
        &lt;webHttpEndpoint&gt;
          &lt;standardEndpoint name=""
                            crossDomainScriptAccessEnabled="false"
                            helpEnabled="true"
                            automaticFormatSelectionEnabled="true" /&gt;
        &lt;/webHttpEndpoint&gt;
      &lt;/standardEndpoints&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I have tried adding the following binding.....however it does not take effect...</p>
  
  <pre><code>  &lt;webHttpBinding&gt;
      &lt;binding name="webHttpBindingDev"&gt;
        &lt;readerQuotas maxDepth="2147483647"
                      maxStringContentLength="2147483647"
                      maxArrayLength="2147483647"
                      maxBytesPerRead="2147483647"
                      maxNameTableCharCount="2147483647" /&gt;
      &lt;/binding&gt;
    &lt;/webHttpBinding&gt;
  </code></pre>
  
  <p>Can you help ?</p>