SlideShare a Scribd company logo
1 of 7
Mule ESB: DataWeave
xml input to Java Object example
This tutorial explains how to develop a
DataWeave transformation from XML to Java
Object.
Pre-requisite:
• Anypoint Studio 5.2.0
• Mule ESB Runtime 3.7.1
• xml input files.
Input XML File
<user>
<name>Annie</name>
<lastName>Point</lastName>
</user>
Mule Flow
Mule Source
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081"
doc:name="HTTP Listener Configuration"/>
<flow name="testweaveFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/"
metadata:id="cab0526f-779e-427c-9a33-be44f9b12696" doc:name="HTTP"/>
<dw:transform-message doc:name="Transform Message">
<dw:input-payload doc:sample="json.json"/>
<dw:set-payload><![CDATA[%dw 1.0
%type user = :object { class: "testweave.User" }
%output application/java
---
{
firstName: payload.user.name,
lastName: payload.user.lastName
} as :user]]></dw:set-payload>
</dw:transform-message>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
</flow>
In the transform code I created the Object type in the
header
“ %type user = :object { class: "testweave.User"} ”
And the payload of the transform is converted to User
Object using the transform logic as below.
{
firstName: payload.user.name,
lastName: payload.user.lastName
} as :user
DataWeave
User.java
package testweave;
public class User {
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
@Override
public String toString() {
// TODO Auto-generated method stub
return this.firstName+" "+this.lastName;
}
}

More Related Content

What's hot

Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in muleKhan625
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in MuleKhan625
 
Mule property placeholder
Mule property placeholderMule property placeholder
Mule property placeholderSashidhar Rao GDS
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector IntegrationAnilKumar Etagowni
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationAnilKumar Etagowni
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties ComponentDurga Prasad Kakarla
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mulejaveed_mhd
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in muleRajkattamuri
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule Rajkattamuri
 

What's hot (11)

Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Message properties component in Mule
Message properties component in MuleMessage properties component in Mule
Message properties component in Mule
 
Mule property placeholder
Mule property placeholderMule property placeholder
Mule property placeholder
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector Integration
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB Integration
 
Mule Message Properties Component
Mule Message Properties ComponentMule Message Properties Component
Mule Message Properties Component
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Choice component in mule
Choice component in mule Choice component in mule
Choice component in mule
 

Viewers also liked

Mule google connectors
Mule google connectorsMule google connectors
Mule google connectorsprinceirfancivil
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaasirfan1008
 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchangePhaniu
 
Mule with facebook
Mule with facebookMule with facebook
Mule with facebookD.Rajesh Kumar
 
Mule esb-microsoft
Mule esb-microsoftMule esb-microsoft
Mule esb-microsoftD.Rajesh Kumar
 
Using xslt in mule
Using  xslt in muleUsing  xslt in mule
Using xslt in muleKhan625
 
Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demoSudha Ch
 
Mule compatible technologies
Mule compatible technologiesMule compatible technologies
Mule compatible technologiesD.Rajesh Kumar
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mulePhaniu
 
Mule soa
Mule soaMule soa
Mule soaPhaniu
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocityKhan625
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mqKhan625
 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollectionPhaniu
 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollectionPhaniu
 
Mule soap
Mule soapMule soap
Mule soapirfan1008
 

Viewers also liked (20)

Mule google connectors
Mule google connectorsMule google connectors
Mule google connectors
 
Mule security jaas
Mule security jaasMule security jaas
Mule security jaas
 
Mule splitters
Mule splittersMule splitters
Mule splitters
 
Soap in mule
Soap in muleSoap in mule
Soap in mule
 
Mule anypoint exchange
Mule anypoint exchangeMule anypoint exchange
Mule anypoint exchange
 
Mule with facebook
Mule with facebookMule with facebook
Mule with facebook
 
Mule esb-microsoft
Mule esb-microsoftMule esb-microsoft
Mule esb-microsoft
 
Using xslt in mule
Using  xslt in muleUsing  xslt in mule
Using xslt in mule
 
Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demo
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule compatible technologies
Mule compatible technologiesMule compatible technologies
Mule compatible technologies
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Mule soa
Mule soaMule soa
Mule soa
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollection
 
Mule
MuleMule
Mule
 
Mule for each scope headerc ollection
Mule for each scope headerc ollectionMule for each scope headerc ollection
Mule for each scope headerc ollection
 
Mule soap
Mule soapMule soap
Mule soap
 
Http mule
Http muleHttp mule
Http mule
 

Similar to Mule esb

Mulesoft xml to Java Conversion
Mulesoft xml to Java ConversionMulesoft xml to Java Conversion
Mulesoft xml to Java Conversionv srikanth
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeF K
 
Caching invalidating with managed store
Caching invalidating with managed storeCaching invalidating with managed store
Caching invalidating with managed storePraneethchampion
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storejaveed_mhd
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storemdfkhan625
 
Caching invalidating with managed store
Caching invalidating with managed storeCaching invalidating with managed store
Caching invalidating with managed storeAbdulImrankhan7
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeKhasim Saheb
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeMohammed246
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeSunil Komarapu
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeHasan Syed
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeirfan1008
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed storeSunil Komarapu
 
Caching & validating
Caching & validatingCaching & validating
Caching & validatingSon Nguyen
 

Similar to Mule esb (20)

Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
 
Mule XML java sample
Mule XML java sampleMule XML java sample
Mule XML java sample
 
Mulexml java
Mulexml javaMulexml java
Mulexml java
 
Mulesoft xml to Java Conversion
Mulesoft xml to Java ConversionMulesoft xml to Java Conversion
Mulesoft xml to Java Conversion
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching invalidating with managed store
Caching invalidating with managed storeCaching invalidating with managed store
Caching invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching invalidating with managed store
Caching invalidating with managed storeCaching invalidating with managed store
Caching invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
 
Caching & validating
Caching & validatingCaching & validating
Caching & validating
 
Mule smtp connector
Mule smtp connectorMule smtp connector
Mule smtp connector
 

More from Khan625

Mapping and listing in mule
Mapping and listing in muleMapping and listing in mule
Mapping and listing in muleKhan625
 
Jenkins Build System
Jenkins Build SystemJenkins Build System
Jenkins Build SystemKhan625
 
Building and Managing Projects with Maven
Building and Managing Projects with MavenBuilding and Managing Projects with Maven
Building and Managing Projects with MavenKhan625
 
Web services soap
Web services soapWeb services soap
Web services soapKhan625
 
Web services wsdl
Web services wsdlWeb services wsdl
Web services wsdlKhan625
 
Web services uddi
Web services uddiWeb services uddi
Web services uddiKhan625
 
Web services with soap
Web services with soapWeb services with soap
Web services with soapKhan625
 
Maven
Maven Maven
Maven Khan625
 
WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic OverviewKhan625
 
Java Basics
Java BasicsJava Basics
Java BasicsKhan625
 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groupsKhan625
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with muleKhan625
 
Data weave
Data weave Data weave
Data weave Khan625
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gatewayKhan625
 
Mule with drools
Mule with droolsMule with drools
Mule with droolsKhan625
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple fileKhan625
 
Mule with quartz
Mule with quartzMule with quartz
Mule with quartzKhan625
 
Scatter gather flow control
Scatter gather flow controlScatter gather flow control
Scatter gather flow controlKhan625
 
Simple groovy example in mule
Simple groovy example in muleSimple groovy example in mule
Simple groovy example in muleKhan625
 
Simple web service vm
Simple web service vmSimple web service vm
Simple web service vmKhan625
 

More from Khan625 (20)

Mapping and listing in mule
Mapping and listing in muleMapping and listing in mule
Mapping and listing in mule
 
Jenkins Build System
Jenkins Build SystemJenkins Build System
Jenkins Build System
 
Building and Managing Projects with Maven
Building and Managing Projects with MavenBuilding and Managing Projects with Maven
Building and Managing Projects with Maven
 
Web services soap
Web services soapWeb services soap
Web services soap
 
Web services wsdl
Web services wsdlWeb services wsdl
Web services wsdl
 
Web services uddi
Web services uddiWeb services uddi
Web services uddi
 
Web services with soap
Web services with soapWeb services with soap
Web services with soap
 
Maven
Maven Maven
Maven
 
WebServices Basic Overview
WebServices Basic OverviewWebServices Basic Overview
WebServices Basic Overview
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Mmc rest api user groups
Mmc rest api user groupsMmc rest api user groups
Mmc rest api user groups
 
Mapping and listing with mule
Mapping and listing with muleMapping and listing with mule
Mapping and listing with mule
 
Data weave
Data weave Data weave
Data weave
 
Anypoint data gateway
Anypoint data gatewayAnypoint data gateway
Anypoint data gateway
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
 
Mule with quartz
Mule with quartzMule with quartz
Mule with quartz
 
Scatter gather flow control
Scatter gather flow controlScatter gather flow control
Scatter gather flow control
 
Simple groovy example in mule
Simple groovy example in muleSimple groovy example in mule
Simple groovy example in mule
 
Simple web service vm
Simple web service vmSimple web service vm
Simple web service vm
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Mule esb

  • 1. Mule ESB: DataWeave xml input to Java Object example
  • 2. This tutorial explains how to develop a DataWeave transformation from XML to Java Object. Pre-requisite: • Anypoint Studio 5.2.0 • Mule ESB Runtime 3.7.1 • xml input files. Input XML File <user> <name>Annie</name> <lastName>Point</lastName> </user>
  • 4. Mule Source <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/> <flow name="testweaveFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/" metadata:id="cab0526f-779e-427c-9a33-be44f9b12696" doc:name="HTTP"/> <dw:transform-message doc:name="Transform Message"> <dw:input-payload doc:sample="json.json"/> <dw:set-payload><![CDATA[%dw 1.0 %type user = :object { class: "testweave.User" } %output application/java --- { firstName: payload.user.name, lastName: payload.user.lastName } as :user]]></dw:set-payload> </dw:transform-message> <byte-array-to-string-transformer doc:name="Byte Array to String"/> </flow>
  • 5. In the transform code I created the Object type in the header “ %type user = :object { class: "testweave.User"} ” And the payload of the transform is converted to User Object using the transform logic as below. { firstName: payload.user.name, lastName: payload.user.lastName } as :user
  • 7. User.java package testweave; public class User { private String firstName; private String lastName; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } @Override public String toString() { // TODO Auto-generated method stub return this.firstName+" "+this.lastName; } }