I am using REST call builder to call a REST service (running on a BAM Server). I am getting response data in JSON format. I want to display it in tabular format. I am not able to display it. Can anyone give a simple example using REST call builder along with Dojo Data Store and Dojo Data Grid preferably? Many thanks in advance.
Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Pinned topic Looking for simple example using REST call builder and JSON format
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2011-01-19T18:43:26Z at 2011-01-19T18:43:26Z by SystemAdmin
Re: Looking for simple example using REST call builder and JSON format2011-01-19T07:06:35ZThis is the accepted answer. This is the accepted answer.Please see attached file containing example JSON data. I am getting this data from REST Service. I want to display this JSON data in tabular format. Can anyone please give me small example to display this data in a tabular format? Many thanks in advance.
Re: Looking for simple example using REST call builder and JSON format2011-01-19T16:35:10ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
So the first option would be to pester whoever owns the REST service and try to get them to offer a version of it that returns XML.
If that isn't possible, then you will have to do it yourself, I'm afraid. I suggesting putting it in a separate model and making your own service definition and service operation builders. Make a method which takes the same arguments, calls your REST service, does the conversion to IXml, and returns your constructed IXml. Hand-create a schema that describes Point the operation at this method with the hand-created schema.
Note: If you aren't adept at XSD then an easy way to create a schema is to make a variable with some sample data (include a second copy of anything that repeats) and point a Simple Schema Generator builder at it. Then right-click the SSG builder and convert it to be a schema builder. It will create the Schema builder initialized with the created schema, which you then can tweak with proper data types and the like.
The IXml interface is well-documented. You'll want to use that and the XmlUtil class to create the top level.
Sorry I haven't a better answer.
Re: Looking for simple example using REST call builder and JSON format2011-01-19T18:43:26ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Here are some pointers to classes on the WPF Java doc to get you started.
Basically you can create your own restructure handler that extends JsonRestructureHandler. In your restructure handler you can take over the getConversionHandler() method which must return a JSON2XMLHandler. You can create your own version of a JSON2XMLHandler by extending the com.bowstreet.util.JSON2XMLHandlerImpl class. In your JSON2XMLHandler class you can take over the base class methods as needed.