Graphic.fromJson() always returning null.

1109
1
01-03-2012 06:20 AM
danielconrad
New Contributor
Hello,

I am working on an application that makes use of a Server Object Extension that has an operation that returns an array of graphics that is formatted as json.  When I was using the beta sdk I was able to call Graphic.fromJson() on each json object in the array and would get a graphic back. 

I have updated to the new version of the sdk and now Graphic.fromJson() always returns null for the same response from the SOE.  I have even created some simple json strings that contain attributes and geometry and I receive null for them also.

For sanity checking, I have tested the FeatureSet.fromJson() method and GeometryEngine.jsonToGeometry() to make sure that I am setting up a valid JsonParser and they both work.

Are there other required values that need to be in the json for a graphic other than attributes and geometry?

Thanks.
0 Kudos
1 Reply
ArchanaAgarwal
New Contributor III
hi,

This looks like a bug. A workaround would be to call Parser.NextToken() before making the Graphic.FromJSON() call.


thanks
Archana