Note that there are some explanatory texts on larger screens.

plurals
  1. POJSON parameter size limit
    text
    copied!<p>I am calling my WCF Web service using jQuery $.ajax json POST.<br/><br/> One of the input parameters is very long - over 8000 bytes. The data in it is a comma-separated list of GUIDs, like this "78dace54-1eea-4b31-8a43-dcd01e172d14,ce485e64-e7c6-481c-a424-2624371180aa,ede4c606-f743-4e0a-a8cc-59bcffa7feda,f0a81ed1-80db-4f6d-92d7-2fc47759a409".<br/><br/> When that parameter is <strong>8176 bytes</strong> long, the <strong>request succeeds</strong>. When it's <strong>8213</strong> (one more comma and GUID) - the <strong>request fails</strong>.<br/><br/> It fails from the browser and from Fiddler (HTTP debugging proxy). I added this to the webservice config:</p> <pre><code>&lt;configuration&gt; &lt;system.web.extensions&gt; &lt;scripting&gt; &lt;webServices&gt; &lt;jsonSerialization maxJsonLength="50000000" recursionLimit="50000"/&gt; &lt;/webServices&gt; &lt;/scripting&gt; &lt;/system.web.extensions&gt; </code></pre> <p>That does not make any difference, the request still fails for input param over 8176 bytes long.<br/> That input param maps into a String on the WCF side. <br/> What am I missing? Thank you!</p> <p>UPDATE, this solved my problem: Turns out that this setting controls the total JSON message length</p> <pre><code>&lt;webServices&gt; &lt;jsonSerialization maxJsonLength="50000000" recursionLimit="50000"/&gt; &lt;/webServices&gt; </code></pre> <p>There is another setting that controls maximum length for individual parameters:</p> <pre><code>&lt;bindings&gt; &lt;webHttpBinding&gt; &lt;binding name="Binding_Name" maxReceivedMessageSize="900000"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="900000" maxBytesPerRead="900000" maxArrayLength="120000" maxNameTableCharCount="120000"/&gt; &lt;/binding&gt; &lt;/webHttpBinding&gt; &lt;/bindings&gt; </code></pre> <p>Also, make sure to set this:</p> <pre><code> &lt;system.web&gt; &lt;httpRuntime maxRequestLength="900000"/&gt; </code></pre> <p>Hope this takes care of some headaches out there!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload