CentraSite Documentation : Runtime Governance with CentraSite : Important Considerations when Configuring REST or XML Virtual Services : Working with the JSON Content-Type : Multiple Root Nodes in JSON REST Services
Multiple Root Nodes in JSON REST Services
With REST virtual services, when working with requests and responses of the Content-Type application/json, the message content can contain one or more root nodes. For example, a message might have the two root nodes {“firstName": “John”, “lastName”: “Smith”}. Note the following points for messages with multiple root nodes:
*The XSLT provided in the Request/Response Processing step should have the XPath start with //, for example //firstName. This is because during the processing of the JSON content, Mediator will wrap the given content with system-defined elements.
*webMethods IS services that you invoke in the Request/Response Processing step will contain the JSON content in the variable called JSONRESTContentString. You can update the content in the IS service and put the updated content into the pipeline's input variable UpdatedJSONRESTContentString, which will be sent to the native service.
With REST virtual APIs, if you have the XSLT or webMethods IS services defined in the Request/Response Handling actions, then you must have the method name prefixed to the resource name in order to reference to that particular resource. For example, if you have the resource name phones defined with a GET method, you would reference it as GET_phones.
Copyright © 2005-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback