Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsJSON string to structured data type conversion.
https://www.eclipse.org/forums/index.php/mv/msg/1070506/1708981/#msg_1708981
I am looking for an example source or help to convert JSON string to structured data type.
I am using IPP browser modeller and making a call to web service which returns me a JSON string
e.g.
[{"Id":5,"Name":"abc","eMail":"abcd@abc.com","isActive":1},
{"Id":6,"Name":"def","eMail":"pqr@abc.com","isActive":1}]
And I want to convert it into structured data type named
Student - which having all four fields.
Id, Name, eMail, isActive.
Which application type will help to covert the JSON string to Structure data. Or any example source or any pointer.
Thanks in advance.]]>Ts Patil2015-09-23T06:38:34-00:00Re: JSON string to structured data type conversion.
https://www.eclipse.org/forums/index.php/mv/msg/1070506/1709110/#msg_1709110
Do you see this defined SDT changing (business object), or will remain the same? If static there could be a straight forward conversion to SDT, or else if the JSON/format is changing it could be you will have to use the Script invocation app and write a custom script.]]>Vikram Kodak2015-09-24T07:06:51-00:00Re: JSON string to structured data type conversion.
https://www.eclipse.org/forums/index.php/mv/msg/1070506/1709127/#msg_1709127
Attached is the testModel which converts the JSONdata to SDT.
The model takes the input as a PrimitiveData(String) as follows:
{"Students":[{"Id":5,"Name":"abc","eMail":"abcd@abc.com","isActive":1},
{"Id":6,"Name":"def","eMail":"pqr@abc.com","isActive":1}]}
which Stores the result in the SDT Data "Students". Model uses GenericCamel Application for the Conversion.
Hope this helps!!
-Cheers
Ashish
]]>Ashish Khole2015-09-24T09:43:59-00:00Re: JSON string to structured data type conversion.
https://www.eclipse.org/forums/index.php/mv/msg/1070506/1709150/#msg_1709150
Jeevak Gajbhiye2015-09-24T13:25:54-00:00Re: JSON string to structured data type conversion.
https://www.eclipse.org/forums/index.php/mv/msg/1070506/1709154/#msg_1709154
Thanks Ashish Khole, Vikram
It worked for me.]]>Ts Patil2015-09-24T13:31:46-00:00