cancel
Showing results for 
Search instead for 
Did you mean: 

JSON to XML conversion error for REST receiver adapter

Former Member
0 Kudos

Hi All,


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

PI is sending the request to REST URL in JSON format. For multiple record PI channel is generating JSON in correct format but when we are sending request with single record PI channel is not generating “[ “ (square bracket) for an array field as required in JSON format.

Below is the required JSON format:

{

"A": "abc",

"B": "def",

"C": TRUE,

"Items": [

       

        { "T": "123ASD", "c": false }

    ]

}

Below is the JSON generated by PI:

{

"A": "abc",

"B": "def",

"C": TRUE,

"Items":              

{ "T": "123ASD", "c": false }

   }

Please suggest.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nida,

This is a bug in the standard XML to JSON conversion of the REST adapter. According to SAP a fix for this should be included in 7.31 SP17 (scheduled for November).

If you need a workaround before that, you can check my response in this thread:

Cheers,

Christian

Former Member
0 Kudos

Hi Christian,

Thanks for your help. We were running short time so could not try on your suggestion.

I have used XSLT mapping to generate required json.

Thanks alot for your inputs.

Thanks,

Nida

Former Member
0 Kudos

Hi Nida

The Rest Webservice that you are using, is it some free test webservice availabe on internet or client specific?