Select to view content in your preferred language

To/From Json Methods

820
3
04-05-2010 11:01 AM
RyanCooney
Occasional Contributor
Are there any plans to expose ToJson and FromJson methods on objects like geometries and featuresets? This would be very useful! The methods are already there in some form, but they are all internal. Is there a reason they are not exposed the way there are in the Flex and JavaScript APIs?

--Ryan
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
The geometry classes have DataContracts defined on them so you can simply use the DataContractJsonSerializer
0 Kudos
RyanCooney
Occasional Contributor
Right. That's where I started, but it leads me to another problem. The Json generated by a DataContract will be different from the Json a Flex or JavaScript application would understand. I'm looking for a way to generate and consume the common Json format that ArcGIS Server understands.
0 Kudos
PhilipThompson
Emerging Contributor
Were you able to generate your json as desired?
0 Kudos