cancel
Showing results for 
Search instead for 
Did you mean: 

XML to JSON conversion in sync sender REST communication channel

Former Member
0 Kudos

Hello folks

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

There is an array in my response dataType named "user". As flagged in the image below:

When I receive more than one elements in the array, my response JSON contains a "[ " as seen below:

But when I receive just one element in the array, my JSON response does not contains the "[". As seen below:

Since my client web application, which will receive this response, is already ready, I have to follow its standards and add the "[" in all cases of responses.

Please can someone help me out in resolving this issue?

Best Regards,

Caio Dounis

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Caio,

Were you able to resolve this issue.

I am also in same situation

Thanks in advance

Ravijeet

iaki_vila
Active Contributor
0 Kudos

Hi Caio.

Please check

I think Rest adapter can't work with arrays at root level, you can try with the module adapter developed by Eng.

Regards.

Former Member
0 Kudos

Hi Iñaki, thank you for your attention.

I've read about the Eng`s module`s parameters but there's nothing specific about it.

Also the array is not at the root level. The problem is just that I need the brackets around the array in my JSON response even with only one result.

Regards.