SlideShare a Scribd company logo
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

File component in mule
File component in muleFile component in mule
File component in mule
Rajkattamuri
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Source
akashdprajapati
 
Configurare http mule
Configurare http muleConfigurare http mule
Configurare http mule
Antonio Pellegrino
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
Sudha Ch
 
Using XSLT in Mule
Using XSLT in MuleUsing XSLT in Mule
Using XSLT in Mule
Anirban Sen Chowdhary
 
File component in mule demo
File component in mule demoFile component in mule demo
File component in mule demo
Sudha Ch
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB Integration
AnilKumar Etagowni
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
Rajkattamuri
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
Mohammed246
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
Praneethchampion
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
AnilKumar Etagowni
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
javeed_mhd
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in mule
Ramakrishna kapa
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
Praneethchampion
 
Quartz component in mule demo
Quartz component in mule demoQuartz component in mule demo
Quartz component in mule demo
Sudha Ch
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
Shahid Shaik
 

What's hot (16)

File component in mule
File component in muleFile component in mule
File component in mule
 
MuleSoft ESB Composite Source
MuleSoft ESB Composite SourceMuleSoft ESB Composite Source
MuleSoft ESB Composite Source
 
Configurare http mule
Configurare http muleConfigurare http mule
Configurare http mule
 
Message properties component in mule demo
Message properties component in mule demoMessage properties component in mule demo
Message properties component in mule demo
 
Using XSLT in Mule
Using XSLT in MuleUsing XSLT in Mule
Using XSLT in Mule
 
File component in mule demo
File component in mule demoFile component in mule demo
File component in mule demo
 
Dropbox connector Mule ESB Integration
Dropbox connector Mule ESB IntegrationDropbox connector Mule ESB Integration
Dropbox connector Mule ESB Integration
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule esb :Data Weave
Mule esb :Data WeaveMule esb :Data Weave
Mule esb :Data Weave
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
How to get http query parameters in mule
How to get http query parameters in muleHow to get http query parameters in mule
How to get http query parameters in mule
 
xslt in mule
xslt in mulexslt in mule
xslt in mule
 
Quartz component in mule demo
Quartz component in mule demoQuartz component in mule demo
Quartz component in mule demo
 
Mule Webservices
Mule WebservicesMule Webservices
Mule Webservices
 

Viewers also liked

Crossing Boundaries - Identifying antecedents of intra and inter team learnin...
Crossing Boundaries - Identifying antecedents of intra and inter team learnin...Crossing Boundaries - Identifying antecedents of intra and inter team learnin...
Crossing Boundaries - Identifying antecedents of intra and inter team learnin...Marie Louise ter Horst
 
Recursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learningRecursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learning
José Manuel Vázquez Aguila
 
Recursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learningRecursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learning
José Manuel Vázquez Aguila
 
El monstruo de la inflacion
El monstruo de la inflacionEl monstruo de la inflacion
El monstruo de la inflacion
emmanuelpocovi
 
Mi cerebro y yo – el dinero
Mi cerebro y yo – el dineroMi cerebro y yo – el dinero
Mi cerebro y yo – el dinero
emmanuelpocovi
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
Hasan Syed
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
Hasan Syed
 
Evaluation
EvaluationEvaluation
Evaluation
arossia2
 
Trabajo de cultura ciudadana
Trabajo de cultura ciudadanaTrabajo de cultura ciudadana
Trabajo de cultura ciudadana
Vidal Rivera Diaz
 
3_Seed Pencil
3_Seed Pencil3_Seed Pencil
3_Seed PencilHan Park
 
Función de las digestión y los nutrientes
Función de las digestión y los nutrientesFunción de las digestión y los nutrientes
Función de las digestión y los nutrientes
Isaac Cea
 
Pregledni članak
Pregledni članakPregledni članak
Pregledni članak
branka123456
 
Mineria cuadros estadisiticos
Mineria cuadros estadisiticosMineria cuadros estadisiticos
Mineria cuadros estadisiticos
JOEL MORALES
 

Viewers also liked (15)

Crossing Boundaries - Identifying antecedents of intra and inter team learnin...
Crossing Boundaries - Identifying antecedents of intra and inter team learnin...Crossing Boundaries - Identifying antecedents of intra and inter team learnin...
Crossing Boundaries - Identifying antecedents of intra and inter team learnin...
 
Recursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learningRecursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learning
 
Recursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learningRecursamiento diseña-y-administra-plataformas-e-learning
Recursamiento diseña-y-administra-plataformas-e-learning
 
El monstruo de la inflacion
El monstruo de la inflacionEl monstruo de la inflacion
El monstruo de la inflacion
 
Mi cerebro y yo – el dinero
Mi cerebro y yo – el dineroMi cerebro y yo – el dinero
Mi cerebro y yo – el dinero
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
 
E learning
E learningE learning
E learning
 
Cache for community edition
Cache for community editionCache for community edition
Cache for community edition
 
FINAL REPORT-reduced
FINAL REPORT-reducedFINAL REPORT-reduced
FINAL REPORT-reduced
 
Evaluation
EvaluationEvaluation
Evaluation
 
Trabajo de cultura ciudadana
Trabajo de cultura ciudadanaTrabajo de cultura ciudadana
Trabajo de cultura ciudadana
 
3_Seed Pencil
3_Seed Pencil3_Seed Pencil
3_Seed Pencil
 
Función de las digestión y los nutrientes
Función de las digestión y los nutrientesFunción de las digestión y los nutrientes
Función de las digestión y los nutrientes
 
Pregledni članak
Pregledni članakPregledni članak
Pregledni članak
 
Mineria cuadros estadisiticos
Mineria cuadros estadisiticosMineria cuadros estadisiticos
Mineria cuadros estadisiticos
 

Similar to Mule esb

Mule xml java
Mule xml javaMule xml java
Mule xml java
VirtusaPolaris
 
Mule xml java
Mule xml javaMule xml java
Mule xml java
Nagendra Kumar
 
Mulexml java
Mulexml javaMulexml java
Mulexml java
Vishnukanth Rachineni
 
Mule XML java sample
Mule XML java sampleMule XML java sample
Mule XML java sample
Vishnukanth Rachineni
 
Mulesoft xml to Java Conversion
Mulesoft xml to Java ConversionMulesoft xml to Java Conversion
Mulesoft xml to Java Conversion
v srikanth
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
Santhosh Ramagiri
 
Mule xml parsing
Mule xml parsingMule xml parsing
Mule xml parsing
Muralidhar Gumma
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
F K
 
Caching invalidating with managed store
Caching invalidating with managed storeCaching invalidating with managed store
Caching invalidating with managed store
Praneethchampion
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
Khasim Saheb
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
Mohammed246
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
javeed_mhd
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
mdfkhan625
 
Caching invalidating with managed store
Caching invalidating with managed storeCaching invalidating with managed store
Caching invalidating with managed store
AbdulImrankhan7
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
Sunil Komarapu
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
irfan1008
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
Sunil Komarapu
 
Caching and invalidating with managed store
Caching and invalidating with managed storeCaching and invalidating with managed store
Caching and invalidating with managed store
Hasan Syed
 
Caching & validating
Caching & validatingCaching & validating
Caching & validating
Son Nguyen
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector Integration
AnilKumar Etagowni
 

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
 
Mulexml java
Mulexml javaMulexml java
Mulexml java
 
Mule XML java sample
Mule XML java sampleMule XML java sample
Mule XML java sample
 
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 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 & validating
Caching & validatingCaching & validating
Caching & validating
 
Mule ESB SMTP Connector Integration
Mule ESB SMTP Connector  IntegrationMule ESB SMTP Connector  Integration
Mule ESB SMTP Connector Integration
 

More from Hasan Syed

Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
Hasan Syed
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
Hasan Syed
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
Hasan Syed
 
Simple web service vm
Simple web service vmSimple web service vm
Simple web service vm
Hasan Syed
 
Scatter gather flow control
Scatter gather flow controlScatter gather flow control
Scatter gather flow control
Hasan Syed
 
Mule with velocity
Mule with velocityMule with velocity
Mule with velocity
Hasan Syed
 
Mule with rabbit mq
Mule with rabbit mqMule with rabbit mq
Mule with rabbit mq
Hasan Syed
 
Mule with quartz
Mule with quartzMule with quartz
Mule with quartz
Hasan Syed
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
Hasan Syed
 
Maven iii
Maven iiiMaven iii
Maven iii
Hasan Syed
 
Maven ii
Maven iiMaven ii
Maven ii
Hasan Syed
 
Maven part 1
Maven part 1Maven part 1
Maven part 1
Hasan Syed
 
Jenkins3
Jenkins3Jenkins3
Jenkins3
Hasan Syed
 
Jenkins2
Jenkins2Jenkins2
Jenkins2
Hasan Syed
 
Jenkins
JenkinsJenkins
Jenkins
Hasan Syed
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
Hasan Syed
 
Groovy with mule
Groovy with muleGroovy with mule
Groovy with mule
Hasan Syed
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
Hasan Syed
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
Hasan Syed
 

More from Hasan Syed (19)

Xslt in mule
Xslt in muleXslt in mule
Xslt in mule
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
 
Simple web service vm
Simple web service vmSimple web service vm
Simple web service vm
 
Scatter gather flow control
Scatter gather flow controlScatter gather flow control
Scatter gather flow control
 
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 with quartz
Mule with quartzMule with quartz
Mule with quartz
 
Mule with drools
Mule with droolsMule with drools
Mule with drools
 
Maven iii
Maven iiiMaven iii
Maven iii
 
Maven ii
Maven iiMaven ii
Maven ii
 
Maven part 1
Maven part 1Maven part 1
Maven part 1
 
Jenkins3
Jenkins3Jenkins3
Jenkins3
 
Jenkins2
Jenkins2Jenkins2
Jenkins2
 
Jenkins
JenkinsJenkins
Jenkins
 
Idempotent filter with simple file
Idempotent filter with simple fileIdempotent filter with simple file
Idempotent filter with simple file
 
Groovy with mule
Groovy with muleGroovy with mule
Groovy with mule
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 

Recently uploaded

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 

Recently uploaded (20)

Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 

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; } }