Custom JSONDecoder for ID Task Result

562
3
02-07-2012 07:21 AM
BrianBehling
New Contributor III
The problem:
When the ESRI API decodes a response from the identify task, there is a few second lock in the Flash application which is due to the decoding of the results.

I have used chunk parsing algorithms in action script to prevent the UI from locking, and I would like to implement this for the ID task response decoding.

I assume the class I need to extend is the com.esri.serlization.jason.JSONDecoder class. Does anyone know how I can get that code so I can re-write it, and use this extended class to parse the results from the ID task? Or, if I use a third party JSON decoder and re-write it, how can I use this class to parse the results from the ID task?

Thanks
Tags (2)
0 Kudos
3 Replies
DasaPaddock
Esri Regular Contributor
Customizing the JSONDecoder class is not supported. You could use HTTPService to make the REST request directly and then decode the result using a different decoder.
http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/identify.html

Another option is trying ArcGIS API 3.0 Beta 1 since it uses the Flash Player's native JSON class when running in FP 11+ and this is very fast:
http://resourcesbeta.esri.com/en/webapis/flex-api/community/
http://resourcesbeta.esri.com/en/webapis/flex-api/apiref/com/esri/ags/utils/JSONUtil.html
0 Kudos
BrianBehling
New Contributor III
Thanks for the reply. I'll give this a try.
0 Kudos
BrianBehling
New Contributor III
I found this pretty cool JSON asynchronous decoder below.

http://blog.brokenfunction.com/2010/10/actionjson-the-fastest-actionscript-3-0-json-parser/

Using the JsonDecoderAsync and green threading techniques adopted from JavaScript, I can parse through an identify result with about 3000 without any UI locks.
0 Kudos