Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

JSON to XML conversion in receiver REST communication channel

Hi Experts,

I am currently working on a Proxy to REST (synchronous) scenario, and have used SAP's REST adapter in the receiver communication channel.

I am using the GET operation here on the 'Waste-streams' resource of the target system's REST API, and am trying to retrieve all the Waste Streams for which the ChapterCode field is '01'.

This REST service of the target's system seems to be accepting the source message in XML format, but sends back a response message in the JSON format only. Hence I need to convert this JSON response into an XML structure that would match the response data type that I have created in the ESR. However, in this JSON to XML conversion, I am getting the following error: Error validating JSON input at

A JSONObject text must begin with '{' at character 1 of [{"ChapterCode":"01","Description":"wastes resulting from exploration,mining,quarrying,and physical and chemical treatment of minerals","StreamCode":"","SubChapterCode":""},{.... (followed by the entire JSON payload that the REST service sends back.

Below are the details that I have used in the Data Format tab of my receiver communication channel:

Here, 'Response' is the root node of the Message type created in the ESR to accept the response message that the service sends back.

Please can someone help me out in resolving this issue.



Former Member

Hi Jyotika

I have updated and released a new version of the converter class.

After you have deployed the custom adapter module, add the following module AFTER the last module in the REST adapter in order to process the response message. This will generate the above XML payload based on your JSON input. You can adjust some of the names according to your interface requirements. Make sure that you also disable the JSON to XML conversion in the SAP REST receiver channel.

Module NameTypeModule Key
Custom_AF_Modules/FormatConversionBeanLocal Enterprise Beanjson2xml

Module KeyParameter NameParameter Value

For further reference on the usage of the converter, refer to the following document.

JSONTransformBean Part 1: Converting JSON content to XML

For more information (where to download the latest source code or EAR deployment file) on the parent module bean, refer to the following blog

FormatConversionBean - One Bean to rule them all!


Eng Swee

0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question