cancel
Showing results for 
Search instead for 
Did you mean: 

Handling Response message in REST Receiver in format other than jason.

bhargava_dns
Participant
0 Kudos
416

In sap PO 7.5 we are having a rest receiver channel , where the request is sent in JSON, but the response that we are getting is not in the format of JSON but some HTTP response which contains simple message like SUCESS: 100:123 or FAIL :200:123 .

The po system is unable to handle this message and throwing an error saying invalid json format.

How to handle this kind of responses which are not JSON.

Accepted Solutions (0)

Answers (2)

Answers (2)

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can actually configure the data format of your response in the REST receiver channel. Not sure if you have selected JSON in combination with Convert to XML, if so can you try to switch off the Conversion? Otherwise, an option would be to select Binary as format, this should definitely work.

Alex

bhargava_dns
Participant
0 Kudos

I have switched of the conversion of json to xml, as the conversion is throwing error saying invalid json.

If the option binary is selected how to extract the content.

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

the content is not an xml nor a json anyway, so binary would be the right option anyway

what do you mean with extracting the content? The response regardless what you specify in the REST receiver adapter will be stored in the XI message, since this is not an xml you can't use a message mapping for the response, so you may need to create a Java mapping or an XSLT if you like to map the response to an xml

Alex

bhargava_dns
Participant
0 Kudos

can you please clarifying what is the format of binary( is it a string or any other format … as I am new to PI)

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

any format

PriyankaChak
Active Contributor
0 Kudos

Hi Bhargava,

You can inform your target system to send message body in JSON format.

Regards,

Priyanka

bhargava_dns
Participant
0 Kudos

We have requested the target system...but they have declined the request