Skip to Content

SAP Rest adapter - Array type

We are using the XML-JSON conversion table to identify XML elements as Array.

Unfortunately, we have an element that appears as both Array and non-Array (under a different node). When we specify an element as Array, all occurances of that element is sent as an Array. Is there any way in conversion table to differentiate the element based on their parent node ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Feb 12 at 05:46 AM

    Hi,

    share your xml structure if possible.

    Regards,

    Samir

    Add comment
    10|10000 characters needed characters exceeded

    • It is something like this, The occurance of 'A' at first level is array, while the occurance of 'A' with in parent node 'B' is not an array.

      <xml header>

      <A> </A>

      <A> </A>

      <B>

      <A> </A>

      </B>

      </xml header>

  • Feb 13 at 05:43 AM

    Hi,

    If Array Type is not maintained in Custom XML/JSON Conversion Rules and the XML element only occurs once, the XML element will be converted into a non-array-type. If Array Type is maintained in Custom XML/JSON Conversion Rules, the XML element should always result in a JSON array type even if the element occurs only once. If the XML element occurs more than once, it should result in a JSON array type. For more explanation, you can refer to:

    SAP KBA 2743939 - XML Payload to JSON Conversion in REST receiver adapter

    REST Adapter in PI/PO: Enhanced XML/JSON Conversion

    Best regards,

    Tina

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 16 at 10:58 AM

    Hi,

    If xml is well formatted then try converting it to Json with any third party tool.
    Uncheck convert xml payload to json option in receiver channel or if synchronous scenario then in sender channel and deploy Custom_AF_Modules/FormatConversionBean module and check jsoncontent.
    Regards,
    Samir

    Add comment
    10|10000 characters needed characters exceeded