maxjsonlength in ArcGIS REST SOE

3640
7
04-15-2011 06:05 AM
RameshNarayan
New Contributor
Hi,

How to set "maxjsonlength" in ArcGIS REST SOE.
I am getting an exception like exceeds the max length while returing the JSON String.

Thanks & Regards,
Ramesh
0 Kudos
7 Replies
RaviNarayanan
Esri Contributor
Ramesh,

This is related to the issue described in this bug and will be addressed in 10.0 SP3.

NIM066822 - MaxJsonLength exceeded error message is returned when an input geometry to an SOE contains a large number of vertices


Thanks
Ravi
0 Kudos
YoumeiGe
New Contributor III
Hi,

I am having the same problem with my rest soe on ArcGIS10.

Could someone please provide the following info in helping me to understand the problem
and find a solution.

1) how do we configure maxjsonlength in ArcGIS REST service in ArcGIS10 sp2 ?
2) can we set it as unlimited?
3) more detailed information on bug NIM066822 would be helpful.

Thanks, Youmei
0 Kudos
RaviNarayanan
Esri Contributor
Youmei,

It is not a configurable value, and the default is 4 MB.

http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.maxjson...

A fix for this will be available in 10.0 SP3 (NIM066822). You can contact ESRI Support if you need more information about NIM066822.

Ravi
0 Kudos
YoumeiGe
New Contributor III
Thanks, Ravi.

Now I know it is not a configurable value at the rest soe end.

What value would be used by the fix (NIM066822)? Is it the max value of integer (Int32.MaxValue)?

Thanks, Youmei
0 Kudos
SteeveCouture
New Contributor
Hi,

I use ArcGIS Server 10 SP3. My question is, if this bug is fixed in SP3 for the REST SOE input parameters, did it fix also in the GeometryService? If not, is there something to do?

I think, the GeometryService has still this bug.  This is why:

When I call Simplify (with a large geometry) operation of the geometryService, I got this error:

Ex.:

GeometryService service = new GeometryService(this.GeometryServiceUrl);
service.SimplifyAsync(graphics);

Error:

{"error":{"code":400,"message":"Unable to complete Simplify operation.","details":["Error during the serialization or during the deserialization by means of JSON JavaScriptSerializer. MaxJsonLength exceeded .\r\nParameter name : input"]}}

It's sure, I could make my own SOE to do the same job but I would like to use the services deliveries by ESRI.  If the Geometry service has the bug, do you know if QueryTask has also this bug.

I help would be very appreciate because I'm stuck with it and I must delivery my solution very soon. 


Best regards,
Steeve
0 Kudos
RaviNarayanan
Esri Contributor
Hi Steve,

This MaxJsonLength limit applies to Geometry service. The fix in 10.0 SP3 is specific to SOE's and GeoProcessing services.

The default limit for JSON is about  4MB. We are trying to understand use-cases where JSON larger than this limit is posted as input to service? Have you considered options such as generalizing the geometry using the MaxAllowableOffset parameter in query response.

Please let us know. You can contact ESRI Support and provide details about the application/use-case that requires this support.

Thanks
0 Kudos
BenjaminDwinal
New Contributor II
I have SP3 installed and this does fix the issue with JSON Serializer on lengthy input geometries.  The problem I am facing now is that the ESRI.ArcGIS.REST.SOE.SOERESTJsonFormatter.WriteJsonResponse bombs when trying to format a response that is larger than ~ 100,000 characters.  The context here is a utility network trace that brings back roughly 500 - 600 features.  The problem seems to occur when these features have a large number of attributes or vertices causing the response to exceed the JSON formatter.

It appears that responses coming from non-SOE operations (identify, query) surpass this limit and are formatted fine.   It only occurs on the SOE REST JSON Formatter.
0 Kudos