Based on *.xsd file, we can decode the xml data... same way do we have to decode json data?
JSON is {string:value} and doesnt need any decoding. Not sure what you mean.
I believe you created a RESTful call and want to parse the json response. Were you able to do it? I'm trying to find information but no luck this far.
anybody has clue on this? Can we parse the json response without custom java service?
I had to write the a "by the way" email asking if they had the SOAP version for the services.
The only type of resource you can relate to the binary response of the server are xsd files so I believe this functionality is not available in xCP 2.1. You'll have to write a java class and parse your response.
Luckily I was saved by the WSDL.
Were you able to find a solution for the parsing. I was thinking about this matter and how to build a java class to perform the web service call and parse and which libraries should be used so it wouldn't interfere with any of the product's jars.
Any thoughts on that?
I've used org.json to consume json messages from REST () however you'll need to explicitly code the structure of the json answer, so if something changes you're screwed
just to bring up this post in the top of table.. any clues or any solutions any one has?
Can you provide a little context? Are you using xCP or Documentum? What language is your client written in? What library are you using for HTTP requests and JSON? What exactly are you trying to do?
For Documentum clients written in typical languages, you might want to look at our examples on Github:
https://github.com/Enterprise-Content-Management/documentum-rest-client-html5
https://github.com/Enterprise-Content-Management/documentum-rest-client-java
https://github.com/Enterprise-Content-Management/documentum-rest-client-dotnet
Or are you are trying to serialize object data to Documentum?
We want to call restful service from stateless process HTTP activity to consume rest services from 3rd party app.
provided links are to consume documentum rest services.
what's you xCP version ? There is a 'Send HTTP/RESTful Request' activity template to make REST call but It only supports xml data.
It also supports JSON. But the question is how do we parse the response to map it to attributes.
You need a xml schema of the resource. Take a look at this blog.
xml schema can decode only xml data not json.
Are you looking for something like JSON Schema and Hyper-Schema or JSONPath - XPath for JSON? I would prefer to keep away from a schema as JSON is a very light & simple media type. With Java or any other languages, it's easy to parse the JSON message into key-value data object, and it gives you all the flexibility to navigate the object. If you feel more comfortable to work with POJO properties, libraries like GitHub - FasterXML/jackson-annotations can help you.
All of the above JSON parsing logic relies on the media type (representation) definition of the REST API. It's usually defined in a documentation as examples, not by a schema. That's very different than XML world.
Regards,
William
Any RESTfull service supports both JSON and XML. Based on the Content-Type, service returns data either in XML or JSON form. So as along as service supports XML, one can use RESTFull Activity template for consuming RESTfull services.
Yes william you are in the same lines of my problem. However we dont want to write these on our own. If we need to write custom java to parse.. we can very well do that using some libraries.
My intention is that right now whatever the way we are using in the xCP designer for parsing SOAP services, designer should provide similar mechanism for REST activites as well. Whatever the technology they use it does not matter.
Any way thanks for the inputs on new libraries.