I have been looking for the proper set of configuration parameters to allow a .NET 4 REST service via POST to allow for a JSON string greater than a Content-Length of 8196. Any suggestions would be greatly appreciated. Anything 8196 and below succeeds,
everything above returns a 400 error.
I'm assuming this is hosted in IIS...maybe give this a shot.
add the following to web.config:
within system.web
<httpRuntime maxRequestLength="102400"/>
In your bindings sections set the maxReceivedMessageSize attribute and maxArrayLength values accordingly. Here's an example:
<webHttpBinding>
<binding name="secureBindingConfig" maxReceivedMessageSize="104857600">
<readerQuotas maxDepth="64" maxArrayLength="104857600" />
<!-- Uncomment below for published services -->
<!--<security mode="Transport" />-->
</binding>
</webHttpBinding>
I've used 100MB for this example, be sure to adjust accordingly!
None
0 Points
4 Posts
WCF 4 REST service using JSON. length quota (8192) exceeded
Sep 10, 2010 03:27 PM|out4toys|LINK
Hello,
I have been looking for the proper set of configuration parameters to allow a .NET 4 REST service via POST to allow for a JSON string greater than a Content-Length of 8196. Any suggestions would be greatly appreciated. Anything 8196 and below succeeds, everything above returns a 400 error.
Thanks,
WCF REST WCF REST MaxString quota 4.0 .NET End point restful wcf
Member
120 Points
33 Posts
Re: WCF 4 REST service using JSON. length quota (8192) exceeded
Sep 10, 2010 05:02 PM|davidmuto|LINK
I'm assuming this is hosted in IIS...maybe give this a shot.
add the following to web.config:
I've used 100MB for this example, be sure to adjust accordingly!
None
0 Points
4 Posts
Re: WCF 4 REST service using JSON. length quota (8192) exceeded
Sep 10, 2010 05:25 PM|out4toys|LINK
Thank you for the quick reply. What I was missing was the <httpRuntime> but that did not help. I have to be still missing something. What I have is..
<services>
<service name="myService">
<endPoint address="my fully qualified REST Url" kind="webHttpEndpoint" endpointConfiguration="serviceEndPoint" contract="IService" bindind="webHttpBinding" bindingConfiguration="webBinding" />
</service>
</services>
<Your binding in this post name="webBinding" />
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="serviceEndPoint" />
</webHttpEndPoint>
</standardEndpoints>