Mule ESB: DataWeave Multi/Different Input
This Example explains about handling Multiple Input (JSON,XML) data using DataWeave component.
Pre-requisites
- Anypoint Studio 5.2.0
- ESB Runtime 3.7.1
- JSON Input Data
Mule Flow
http configuration
flowVariable_JSON
flowVariable_XML
[
{
"item": {
"type": "book",
"price": 30,
"properties": {
"title": "Everyday Italian",
"author": [
"Giada De Laurentiis"
],
"year": 2005
}
}
},
{
"item": {
"type": "book",
"price": 29.99,
"properties": {
"title": "Harry Potter",
"author": [
"J K. Rowling"
],
"year": 2005
}
}
},
{
"item": {
"type": "book",
"price": 49.99,
"properties": {
"title": "XQuery Kick Start",
"author": [
"James McGovern",
"Per Bothner",
"Kurt Cagle",
"James Linn",
"Kurt Cagle",
"Vaidyanathan Nagarajan"
],
"year": 2003
}
}
},
{
"item": {
"type": "book",
"price": 39.95,
"properties": {
"title": "Learning XML",
"author": [
"Erik T. Ray"
],
"year": 2003
}
}
}
] |
Flow Response
<?xml version='1.0' encoding='UTF-8'?>
<books>
<book year="2005">
<price currency="EUR">27.60</price>
<price currency="ARS">262.80</price>
<price currency="GBP">19.80</price>
<title>Everyday Italian</title>
<authors>
<author>Giada De Laurentiis</author>
</authors>
</book>
<book year="2005">
<price currency="EUR">27.5908</price>
<price currency="ARS">262.7124</price>
<price currency="GBP">19.7934</price>
<title>Harry Potter</title>
<authors>
<author>J K. Rowling</author>
</authors>
</book>
</books>
|






Nice blog. You have provided such a useful informartion in this blog. Thanks for sharing.
ReplyDeleteMulesoft Online Training