cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping in Cloud Integration

purusottam_agar
Explorer
0 Kudos

Hi Experts,

In Cloud Integration message mapping I am facing one challenge as below.

 Sample sender side xml payload is below:

<root>
<item>
<chequeNo>12345</chequeNo>
<BankName>Alpha</BankName>
</item>
<item>
<chequeNo>45123</chequeNo>
<BankName>Beta</BankName>
</item>
<root>

And the target structure is as below:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element id="root" name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element id="xsdEl_12" name="item" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element id="xsdEl_13" name="chequeNo1" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element id="xsdEl_14" name="BankName1" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element id="xsdEl_15" name="chequeNo2" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element id="xsdEl_16" name="BankName2" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element id="xsdEl_17" name="chequeNo3" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element id="xsdEl_18" name="BankName3" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element></xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

There is chance sometimes 1 item ,sometimes 2 or 3 but not more than 3 will come from sender.

Please suggest how to handle mapping without changing the XSD.

Best Regards,

Purusottam

 

 

 

View Entire Topic
sachin_yadav3
Active Participant

Hi , 

You can add/modify the source xml to include index or Row number and in message mapping using this index/row number as a condition you can map it to respective node i.e. to map with first check if index/row number is 1 and accordingly.