Skip to Content

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

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

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"}]
structure.jpg (33.9 kB)
rest-adapter.jpg (98.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 28 at 09:53 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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