Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Property array in wso2 ESB?

Tags:

wso2

wso2-esb

I have my request body as:

<tns:InputRequest xmlns:tns="http://tempuri.org/">
<tns:ID>ID_001</tns:ID>
<tns:ID>ID_002</tns:ID>
<tns:Description>Description for ID_001</tns:Description>
<tns:Description>Description for ID_002</tns:Description>
</tns:InputRequest>

and to get the value of ID and Description, i Have created property as:

<property xmlns:tns="http://tempuri.org/" name="ID" expression="//tns:ID" scope="default" type="STRING"/>
<property xmlns:tns="http://tempuri.org/" name="Description" expression="//tns:Description" scope="default" type="STRING"/>

But this gets me only one value. How can i make a property array so that i can store multiple values of ID and description in it and how to retreive from this array property?Looking forward to your reply.Thanks in advance

like image 893
Roy Avatar asked Oct 04 '22 03:10

Roy


1 Answers

You should be able to extract those values using XPATH (//node/child::node()) and then set to property.

Below thread will help you to extract required nodes and set to property. You need to set the type as 'OM' to preserve XML as it is.

how to catch an array of nodes to a property

like image 107
Shelan Perera Avatar answered Oct 10 '22 03:10

Shelan Perera