cancel
Showing results for 
Search instead for 
Did you mean: 

Rest Receiver Adapter - XML to JSON issue - HTTP error occurred: Unprocessable Entity

varun_kasireddy
Explorer
0 Kudos

Hi Team,

My Scenario is Proxy to Rest and I am facing issue in converting XML to JSON format Error is : HTTP error occurred: Unprocessable Entity, Below is the target structure

Adapter Screenshot

I am getting this additional node "Data" in the output, how do I remove it

{"Data":[{"FinancialTransactionKey":311,"CompanyCode":"US9V","StatusCode":"ERR"},
{"FinancialTransactionKey":769,"CompanyCode":"US9V","DocumentNumber":"6778","FiscalYear":2018,"StatusCode":"COM"},
{"FinancialTransactionKey":123,"CompanyCode":"test1","DocumentNumber":"123","FiscalYear":2018,"StatusCode":"COM"},
{"FinancialTransactionKey":1234,"CompanyCode":"test2","DocumentNumber":"456","FiscalYear":2018,"StatusCode":"COM"},
{"FinancialTransactionKey":6879,"CompanyCode":"test3","DocumentNumber":"780","FiscalYear":2018,"StatusCode":"COM"}]}

Expected Output is

[{"FinancialTransactionKey":311,"CompanyCode":"888","StatusCode":"ERR"},
{"FinancialTransactionKey":769,"CompanyCode":"666","DocumentNumber":"6778","FiscalYear":2018,"StatusCode":"COM"},
{"FinancialTransactionKey":123,"CompanyCode":"test1","DocumentNumber":"123","FiscalYear":2018,"StatusCode":"COM"},
{"FinancialTransactionKey":1234,"CompanyCode":"test2","DocumentNumber":"456","FiscalYear":2018,"StatusCode":"COM"},
{"FinancialTransactionKey":6879,"CompanyCode":"test3","DocumentNumber":"780","FiscalYear":2018,"StatusCode":"COM"}]

Accepted Solutions (1)

Accepted Solutions (1)

vadimklimov
Active Contributor
0 Kudos

Hi Varun,

Have a look in the SAP Note 2465948 - it introduces new parameter 'setIgnoredElements' for REST adapter, which you can make use of to ignore specific XML elements when producing JSON output. Using this parameter, you can instruct REST receiver communication channel to ignore / remove specific fields (such as 'Data', in your example) that are present in the XML version of the message, from the JSON version of the message.

Regards,

Vadim

varun_kasireddy
Explorer
0 Kudos

Hi Vadim,

Firstly, sorry for the late response.

Good news is, you suggested Note/Module worked as expected.

Appreciate your help, thanks a lot.

Varun

Answers (1)

Answers (1)

0 Kudos

Hi ,

the same same issue am facing now.But using the module i dint got any output. can you please help me out with screen shot may be.