SlideShare a Scribd company logo
Validating a SOAP Request in
Mule
We often come across SOAP web services in our project and
often face different challenges in handling SOAP web
services. One such challenge is SOAP request validation.
.
In Mule ESB we can expose a SOAP webservices and can
handle the request validation in very simple way.
.
Yes, I am talking about using message filter to validate a
SOAP request against a given XSD file
In simple words if we have the XSD file of
web service we can validate the request of
the web service against that XSD using a
schema validation filter in Mule..
Let’s see how…
Let consider we have a SOAP webs ervice exposed in Mule by
following way :-
Now, if we want to validate the request with an XSD file of the web
service and want to throw a custom message in case if the SOAP
request is invalid or incorrect, we need to use schema
validation filter
So after adding schema validation filter in our flow, our flow looks
like the following
We can also add a subflow which will throw custom message if the
SOAP request is invalid as follow :-
So, if we test the webservice with a wrong SOAP request in SoapUI
we will get a custom message :-
This is how the flow works:-
<mulexml:schema-validation-filter name="Schema_Validation"
schemaLocations="MainData.xsd" returnResult="true" doc:name="Schema Validation" />
The code:-
You need to use schema validation filter which will refer to your
XSD files for validating a SOAP request as follows:-
The Schema Validation Filter uses the JAXP libraries to validate a message against
a schema. You must provide the path, file name, and extension of the schema or
schemas in the Schema Locations property.
<flow name="ServiceFlow" doc:name="ServiceFlow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost"
port="8082" path="mainData" doc:name="HTTP"/>
<message-filter onUnaccepted="ValidationFailFlow" doc:name="filter to validate xml
against xsd" throwOnUnaccepted="true" >
<filter ref="Schema_Validation"/>
</message-filter>
<cxf:jaxws-service validationEnabled="true"
serviceClass="com.test.services.schema.maindata.v1.MainData" doc:name="SOAP"/>
<component class="com.test.services.schema.maindata.v1.Impl.MainDataImpl"
doc:name="JavaMain_ServiceImpl"/>
</flow>
A code snipped of the Mule config:-
To get the full code access for implementing a SOAP Request
validator in Mule, please visit :-
http://anirbansenchowdhary.com/blog/?p=131
You can also visit Mule documentation on Schema Validation :-
http://www.mulesoft.org/documentation/display/current/Schema+
Validation+Filter
Validating soap request in mule

More Related Content

What's hot (10)

PPTX
Web service vm in mule
Mohammed246
 
PPTX
Soap request in mule
Praneethchampion
 
PPTX
Soap In Mule
Bui Kiet
 
PPTX
Simple web service vm
Mohammed246
 
PPTX
Mule velocity
Praneethchampion
 
PPTX
Filtering jms messages with mule
Anirban Sen Chowdhary
 
PPTX
Configuration patterns in mule
sathishmca143
 
PPTX
Mule soap
D.Rajesh Kumar
 
PPTX
Webservice vm in mule
Praneethchampion
 
PPT
Flowvar and Sessionvar in Mule
Christian Hipolito
 
Web service vm in mule
Mohammed246
 
Soap request in mule
Praneethchampion
 
Soap In Mule
Bui Kiet
 
Simple web service vm
Mohammed246
 
Mule velocity
Praneethchampion
 
Filtering jms messages with mule
Anirban Sen Chowdhary
 
Configuration patterns in mule
sathishmca143
 
Mule soap
D.Rajesh Kumar
 
Webservice vm in mule
Praneethchampion
 
Flowvar and Sessionvar in Mule
Christian Hipolito
 

Viewers also liked (19)

PPTX
Neurotransmisores y psicofarmacos
carlaoberto25
 
PPTX
La piel
celeste Balvin
 
PPT
Mule deploying a cloud hub application
charan teja R
 
PDF
Arquitectura de computadores-Otros dispositivos y accesorios
Wilmer Dario Fonseca Calixto
 
PDF
Reporte de simulacro
Victorino Ramos Zurita
 
PPT
Phantom limp pain
Ashwina Grover
 
DOCX
El trompo
Milton Vargas
 
PPTX
Tratamiento upp actualizado 2014
Enfyc.blogspot.com
 
PPTX
Aparato locomotor
juanjofuro
 
PPTX
Presen selva
primercicloalqueria
 
PDF
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix
Julian Enrique Almenares Campo
 
PPT
Mule execution
Praneethchampion
 
PPT
Mule security
Praneethchampion
 
PPTX
Aplicaciones y webs para profesionales y pacientes
Enfyc.blogspot.com
 
PDF
132 161 se ciencias sociales 7 la edad moderna-t_5
Julian Enrique Almenares Campo
 
PDF
Guía sobre sistema inmune. 4º Medio, plan común
Hogar
 
PPT
Digestión en Animales
Merce Tronco
 
PDF
instructivo ficha de caracterización sociofamiliar ICBF
fbolivar62
 
PDF
Sistema reproductor
Lizette Maria Acosta
 
Neurotransmisores y psicofarmacos
carlaoberto25
 
Mule deploying a cloud hub application
charan teja R
 
Arquitectura de computadores-Otros dispositivos y accesorios
Wilmer Dario Fonseca Calixto
 
Reporte de simulacro
Victorino Ramos Zurita
 
Phantom limp pain
Ashwina Grover
 
El trompo
Milton Vargas
 
Tratamiento upp actualizado 2014
Enfyc.blogspot.com
 
Aparato locomotor
juanjofuro
 
Presen selva
primercicloalqueria
 
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix
Julian Enrique Almenares Campo
 
Mule execution
Praneethchampion
 
Mule security
Praneethchampion
 
Aplicaciones y webs para profesionales y pacientes
Enfyc.blogspot.com
 
132 161 se ciencias sociales 7 la edad moderna-t_5
Julian Enrique Almenares Campo
 
Guía sobre sistema inmune. 4º Medio, plan común
Hogar
 
Digestión en Animales
Merce Tronco
 
instructivo ficha de caracterización sociofamiliar ICBF
fbolivar62
 
Sistema reproductor
Lizette Maria Acosta
 
Ad

Similar to Validating soap request in mule (20)

PPTX
Mule soap
Anand kalla
 
PPTX
Soap validation
Son Nguyen
 
PPTX
Soap in mule
D.Rajesh Kumar
 
PPTX
Mule soap
Praneethchampion
 
PPTX
Mule soap
Phaniu
 
PPTX
Mule soap
Phaniu
 
PPTX
Mule soap
irfan1008
 
PPTX
Mule soap
princeirfancivil
 
PPTX
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
PPTX
Validation
sivachandra mandalapu
 
PPTX
Mulesoft Soap Service
Ujjawal Kant
 
PPTX
Mule SOAP Fault Component
Ankush Sharma
 
PPTX
Exception handling in mule
nagarajupatangay
 
PPTX
Mule Schema Validation Filter
Ankush Sharma
 
PPTX
Playing with cxf interceptor in mule
Anirban Sen Chowdhary
 
PPTX
Expose web service
Son Nguyen
 
PPTX
Ws security with mule
Anirban Sen Chowdhary
 
PPT
Mule introduction
Satya Sekhar Das Mandal
 
PPTX
Mule ESB Tutorial Part 2
Srikanth N
 
PDF
Global Scale ESB with Mule
Andrew Kennedy
 
Mule soap
Anand kalla
 
Soap validation
Son Nguyen
 
Soap in mule
D.Rajesh Kumar
 
Mule soap
Praneethchampion
 
Mule soap
Phaniu
 
Mule soap
Phaniu
 
Mule soap
irfan1008
 
Mule soap
princeirfancivil
 
Schema validation filter (xml schema validation)
Ankit Lawaniya
 
Mulesoft Soap Service
Ujjawal Kant
 
Mule SOAP Fault Component
Ankush Sharma
 
Exception handling in mule
nagarajupatangay
 
Mule Schema Validation Filter
Ankush Sharma
 
Playing with cxf interceptor in mule
Anirban Sen Chowdhary
 
Expose web service
Son Nguyen
 
Ws security with mule
Anirban Sen Chowdhary
 
Mule introduction
Satya Sekhar Das Mandal
 
Mule ESB Tutorial Part 2
Srikanth N
 
Global Scale ESB with Mule
Andrew Kennedy
 
Ad

More from javeed_mhd (20)

PPTX
For each component in mule
javeed_mhd
 
PPTX
Filter expression in mule
javeed_mhd
 
PPTX
File component in mule
javeed_mhd
 
PPTX
Database component in mule
javeed_mhd
 
PPTX
Choice component in mule
javeed_mhd
 
PPTX
Vm component in mule
javeed_mhd
 
PPTX
Until successful component in mule
javeed_mhd
 
PPTX
Quartz component in mule
javeed_mhd
 
PPTX
Mule management console installation
javeed_mhd
 
PPTX
Mule esb made system integration easy
javeed_mhd
 
PPTX
Message properties component in mule
javeed_mhd
 
PPTX
Junit in mule demo
javeed_mhd
 
PPTX
How to install sonarqube plugin in anypoint
javeed_mhd
 
PPTX
How to commit a project in svn using svn plugin in anypointstudio
javeed_mhd
 
PPTX
Mapping and listing with mule
javeed_mhd
 
PPT
Mule any point exchange
javeed_mhd
 
PPT
Mule esb api layer
javeed_mhd
 
PDF
Mule Maven Plugin
javeed_mhd
 
PPTX
Mule esb stripe
javeed_mhd
 
PPTX
Mule with stored procedure
javeed_mhd
 
For each component in mule
javeed_mhd
 
Filter expression in mule
javeed_mhd
 
File component in mule
javeed_mhd
 
Database component in mule
javeed_mhd
 
Choice component in mule
javeed_mhd
 
Vm component in mule
javeed_mhd
 
Until successful component in mule
javeed_mhd
 
Quartz component in mule
javeed_mhd
 
Mule management console installation
javeed_mhd
 
Mule esb made system integration easy
javeed_mhd
 
Message properties component in mule
javeed_mhd
 
Junit in mule demo
javeed_mhd
 
How to install sonarqube plugin in anypoint
javeed_mhd
 
How to commit a project in svn using svn plugin in anypointstudio
javeed_mhd
 
Mapping and listing with mule
javeed_mhd
 
Mule any point exchange
javeed_mhd
 
Mule esb api layer
javeed_mhd
 
Mule Maven Plugin
javeed_mhd
 
Mule esb stripe
javeed_mhd
 
Mule with stored procedure
javeed_mhd
 

Recently uploaded (20)

PPTX
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
PDF
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPTX
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
PDF
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PDF
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
Manual Testing for Accessibility Enhancement
Julia Undeutsch
 
Next Generation AI: Anticipatory Intelligence, Forecasting Inflection Points ...
dleka294658677
 
Digital Circuits, important subject in CS
contactparinay1
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
NASA A Researcher’s Guide to International Space Station : Earth Observations
Dr. PANKAJ DHUSSA
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Role_of_Artificial_Intelligence_in_Livestock_Extension_Services.pptx
DrRajdeepMadavi
 
Modern Decentralized Application Architectures.pdf
Kalema Edgar
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pdf
ghjghvhjgc
 
Wondershare Filmora Crack Free Download 2025
josanj305
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Bitkom eIDAS Summit | European Business Wallet: Use Cases, Macroeconomics, an...
Carsten Stoecker
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 

Validating soap request in mule

  • 1. Validating a SOAP Request in Mule
  • 2. We often come across SOAP web services in our project and often face different challenges in handling SOAP web services. One such challenge is SOAP request validation. .
  • 3. In Mule ESB we can expose a SOAP webservices and can handle the request validation in very simple way. .
  • 4. Yes, I am talking about using message filter to validate a SOAP request against a given XSD file In simple words if we have the XSD file of web service we can validate the request of the web service against that XSD using a schema validation filter in Mule..
  • 5. Let’s see how… Let consider we have a SOAP webs ervice exposed in Mule by following way :-
  • 6. Now, if we want to validate the request with an XSD file of the web service and want to throw a custom message in case if the SOAP request is invalid or incorrect, we need to use schema validation filter
  • 7. So after adding schema validation filter in our flow, our flow looks like the following
  • 8. We can also add a subflow which will throw custom message if the SOAP request is invalid as follow :-
  • 9. So, if we test the webservice with a wrong SOAP request in SoapUI we will get a custom message :-
  • 10. This is how the flow works:-
  • 11. <mulexml:schema-validation-filter name="Schema_Validation" schemaLocations="MainData.xsd" returnResult="true" doc:name="Schema Validation" /> The code:- You need to use schema validation filter which will refer to your XSD files for validating a SOAP request as follows:- The Schema Validation Filter uses the JAXP libraries to validate a message against a schema. You must provide the path, file name, and extension of the schema or schemas in the Schema Locations property.
  • 12. <flow name="ServiceFlow" doc:name="ServiceFlow"> <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8082" path="mainData" doc:name="HTTP"/> <message-filter onUnaccepted="ValidationFailFlow" doc:name="filter to validate xml against xsd" throwOnUnaccepted="true" > <filter ref="Schema_Validation"/> </message-filter> <cxf:jaxws-service validationEnabled="true" serviceClass="com.test.services.schema.maindata.v1.MainData" doc:name="SOAP"/> <component class="com.test.services.schema.maindata.v1.Impl.MainDataImpl" doc:name="JavaMain_ServiceImpl"/> </flow> A code snipped of the Mule config:-
  • 13. To get the full code access for implementing a SOAP Request validator in Mule, please visit :- http://anirbansenchowdhary.com/blog/?p=131 You can also visit Mule documentation on Schema Validation :- http://www.mulesoft.org/documentation/display/current/Schema+ Validation+Filter