Wednesday, November 8, 2023

JSON Conversion Issue To XML in BPEL - SOA Suite 12c

Problem :

When we invoke a REST API from BPEL we get JSON as response in most of the cases. This JSON can not be used directly in BPEL flow as the native data format is XML. We can use JavaScript though to process the JSON data. We normally use Translate activity to convert JSON to XML. But, during the conversion we often run into conversion/translation issue.


Solution:

If at all you run into the conversion issue, then create a string type variable and assign the JSON response of invoke activity to that string variable. Use this string variable that holds JSON as a string in translate activity, This should resolve the conversion issue as long as the JSON data format and NXSD format are the same.