title: Json web service max content length?
body: <p>I have been building a Asp.net WCF web service with json format. Now I wanted to really test how its working when sending lots of data. The Content-Length of my http post is 65595. Directly when trying to connect I got error "HTTP/1.1 400 Bad Request" back. It seems like it's not even trying. </p>
  
  <p>I know I'm sending valid json and what I'm sending is an array with about 1000 items, and the json for each item looks like this:
  {"oid":0,"am":1,"me":2,"ofooid":0,"fooid":1104,"sync":1,"type":1,"id":1443,"date":"2009-09-24"}</p>
  
  <p>If I just delete one of the items in the array so the total content-length is 65484 it works perfect. So it seems like it's a magic limit around there somewhere. Is it Asp.net that limit the size of the request, and how can I change the max size if that's the case?</p>
  
  <p>My Web.Config file looks like, and I think I should set the maximum value here somewhere but I just don't know where:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;behaviors&gt;
         &lt;endpointBehaviors&gt;
             &lt;behavior name="ServiceAspNetAjaxBehavior"&gt;
                  &lt;enableWebScript  /&gt;
             &lt;/behavior&gt;
         &lt;/endpointBehaviors&gt;
         &lt;serviceBehaviors&gt;
             &lt;behavior name="ServiceBehavior"&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
             &lt;/behavior&gt;
         &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;services&gt;
          &lt;service behaviorConfiguration="ServiceBehavior" name="Service"&gt;
              &lt;endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="Service" /&gt;
          &lt;/service&gt;
      &lt;/services&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>