cancel
Showing results for 
Search instead for 
Did you mean: 

XML to JSON in REST receiver adapter: Can I take the complete JSON from payload field?

Former Member
0 Kudos

Hi,

I have a very simple JSON scenario that is not supported in my current SP because of the array brackets issue.

I would be happy if I could simply create the complete JSON string in a field in the graphical message mapping and then pass it as-is to the REST adapter.

Is this possible?

Just to clarify: My message type will have only one field, and in this field I will put the whole JSON string. I then want the REST adapter to take this string as the JSON payload.

Any ideas?

Thanks

Yoni

Accepted Solutions (0)

Answers (2)

Answers (2)

engswee
Active Contributor
0 Kudos

Hi Yoni

The REST adapter won't be able to take a field of an XML payload and treat it as the JSON payload.

You would need to construct the entire JSON payload using Java mapping instead as graphical mapping will only produce XML output.

What array brackets issue are you facing?

One other alternative is to use a custom adapter module. Coincidentally, I've just updated my module below to handle forcing of JSON arrays. You can check that out to see if it will fit your requirement.

Regards

Eng Swee

former_member203641
Participant
0 Kudos

Hi Yoni,

Can you please update if you want to call third party REST service using receiver REST adapter or you need to provide REST service through PI using Sender REST adapter ?

Thanks,

Amit

Former Member
0 Kudos

Hi Amit,

As I wrote in the header of my message, I am referring to a REST receiver meaning I am calling a third party REST service from PI and I have to pass payload to this service.

Thanks

Yoni