i have a front end page that send a request to an data service deployed to wso2 console for doing an update in a table. The problem is that i need to convert the json array from the front end to an xml format for build the payload factory for the request. The json is :
{"cdcList":
["UpdateCdc":
{
"idCdc":1,
"order":1,
"cdcName":"test 1",
},
"UpdateCdc":
{
"idCdc":2,
"order":2,
"cdcName":"test 2",
"idParent":1
},
"UpdateCdc":
{
"idCdc":3,
"order":1,
"cdcName":"test 3",
"idParent":1
}
]
}
and the desired result in xml that i would like that it will be is :
<cdcList>
<UpdateCdc>
<idCdc>1</idCdc>
<order>1</order>
<cdcName>test 1</cdcName>
</UpdateCdc>
<UpdateCdc>
<idCdc>2</idCdc>
<order>2</order>
<cdcName>test 2</cdcName>
<idParent>1</idParent>
</UpdateCdc>
<UpdateCdc>
<idCdc>3</idCdc>
<order>3</order>
<cdcName>test 3</cdcName>
<idParent>1</idParent>
</UpdateCdc>
</cdcList>
Thank you.