satish moningi
satish moningi

Reputation: 1

Parsing SMO in WebSphere Integration Developer

I am using WID 8.5. I have two service message objects, which contain complex type array. I am trying to get these arrays into my java code and compare the values in both arrays. Based on the comparison, I have to create new array and store it into new service message object. I am getting these arrays using NodeList.

Please find the BO details here.

SMO1

<metadata>
    <values>
        <desc>client country</desc>
        <key>India<key>
    <values>
    <values>
        <desc>client name</desc>
        <key>Satish<key>
    <values>
<metadata>

SMO2 

<metadata>
    <values>
        <desc>client name</desc>
        <key>123<key>
    <values>
    <values>
        <desc>client country</desc>
        <key>124<key>
    <values>
<metadata>

Final SMO
<metadata>
    <values>
        <desc>client name</desc>
        <key>123<key>
        <values>Satish</value>
    </values>
    <values>
        <desc>client country</desc>
        <key>124<key>
        <value>India</value>
    </values>
<metadata>

Please provide me custom java code to accomplish this transformation.

Upvotes: 0

Views: 478

Answers (1)

krishna movva
krishna movva

Reputation: 49

  1. Get whatever elements you want using smo getter methods from smo1 and smo2 Ex:smo.getString(xpath of the smo)

  2. Build a data object with all the elements you got in the first step

  3. Add this data object to the Final smo

Upvotes: 0

Related Questions