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

What's hot (10)

Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
Soap request in mule
Soap request in mule Soap request in mule
Soap request in mule
 
Soap In Mule
Soap In MuleSoap In Mule
Soap In Mule
 
Simple web service vm
Simple web service vmSimple web service vm
Simple web service vm
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Filtering jms messages with mule
Filtering jms messages with muleFiltering jms messages with mule
Filtering jms messages with mule
 
Configuration patterns in mule
Configuration patterns in muleConfiguration patterns in mule
Configuration patterns in mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Flowvar and Sessionvar in Mule
Flowvar and Sessionvar in MuleFlowvar and Sessionvar in Mule
Flowvar and Sessionvar in Mule
 

Viewers also liked

Neurotransmisores y psicofarmacos
Neurotransmisores y psicofarmacosNeurotransmisores y psicofarmacos
Neurotransmisores y psicofarmacoscarlaoberto25
 
Mule deploying a cloud hub application
Mule deploying a cloud hub applicationMule deploying a cloud hub application
Mule deploying a cloud hub applicationcharan teja R
 
Arquitectura de computadores-Otros dispositivos y accesorios
Arquitectura de computadores-Otros dispositivos y accesoriosArquitectura de computadores-Otros dispositivos y accesorios
Arquitectura de computadores-Otros dispositivos y accesoriosWilmer Dario Fonseca Calixto
 
Tratamiento upp actualizado 2014
Tratamiento upp actualizado 2014Tratamiento upp actualizado 2014
Tratamiento upp actualizado 2014Enfyc.blogspot.com
 
Aparato locomotor
Aparato locomotorAparato locomotor
Aparato locomotorjuanjofuro
 
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xixJulian Enrique Almenares Campo
 
Aplicaciones y webs para profesionales y pacientes
Aplicaciones y webs para profesionales y pacientesAplicaciones y webs para profesionales y pacientes
Aplicaciones y webs para profesionales y pacientesEnfyc.blogspot.com
 
Guía sobre sistema inmune. 4º Medio, plan común
Guía sobre sistema inmune. 4º Medio, plan comúnGuía sobre sistema inmune. 4º Medio, plan común
Guía sobre sistema inmune. 4º Medio, plan comúnHogar
 
Digestión en Animales
Digestión en AnimalesDigestión en Animales
Digestión en AnimalesMerce Tronco
 
instructivo ficha de caracterización sociofamiliar ICBF
instructivo ficha de caracterización sociofamiliar ICBFinstructivo ficha de caracterización sociofamiliar ICBF
instructivo ficha de caracterización sociofamiliar ICBFfbolivar62
 

Viewers also liked (19)

Neurotransmisores y psicofarmacos
Neurotransmisores y psicofarmacosNeurotransmisores y psicofarmacos
Neurotransmisores y psicofarmacos
 
La piel
La pielLa piel
La piel
 
Mule deploying a cloud hub application
Mule deploying a cloud hub applicationMule deploying a cloud hub application
Mule deploying a cloud hub application
 
Arquitectura de computadores-Otros dispositivos y accesorios
Arquitectura de computadores-Otros dispositivos y accesoriosArquitectura de computadores-Otros dispositivos y accesorios
Arquitectura de computadores-Otros dispositivos y accesorios
 
Reporte de simulacro
Reporte de simulacroReporte de simulacro
Reporte de simulacro
 
Phantom limp pain
Phantom limp pain Phantom limp pain
Phantom limp pain
 
El trompo
El trompoEl trompo
El trompo
 
Tratamiento upp actualizado 2014
Tratamiento upp actualizado 2014Tratamiento upp actualizado 2014
Tratamiento upp actualizado 2014
 
Aparato locomotor
Aparato locomotorAparato locomotor
Aparato locomotor
 
Presen selva
Presen selvaPresen selva
Presen selva
 
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix
080 103 se ciencias sociales 5 und-4_historia de colombia en el siglo xix
 
Mule execution
Mule executionMule execution
Mule execution
 
Mule security
Mule securityMule security
Mule security
 
Aplicaciones y webs para profesionales y pacientes
Aplicaciones y webs para profesionales y pacientesAplicaciones y webs para profesionales y pacientes
Aplicaciones y webs para profesionales y pacientes
 
132 161 se ciencias sociales 7 la edad moderna-t_5
132 161 se ciencias sociales 7 la edad moderna-t_5132 161 se ciencias sociales 7 la edad moderna-t_5
132 161 se ciencias sociales 7 la edad moderna-t_5
 
Guía sobre sistema inmune. 4º Medio, plan común
Guía sobre sistema inmune. 4º Medio, plan comúnGuía sobre sistema inmune. 4º Medio, plan común
Guía sobre sistema inmune. 4º Medio, plan común
 
Digestión en Animales
Digestión en AnimalesDigestión en Animales
Digestión en Animales
 
instructivo ficha de caracterización sociofamiliar ICBF
instructivo ficha de caracterización sociofamiliar ICBFinstructivo ficha de caracterización sociofamiliar ICBF
instructivo ficha de caracterización sociofamiliar ICBF
 
Sistema reproductor
Sistema reproductorSistema reproductor
Sistema reproductor
 

Similar to Validating soap request in mule

Soap validation
Soap validationSoap validation
Soap validationSon Nguyen
 
Mule soap
Mule soapMule soap
Mule soapPhaniu
 
Mule soap
Mule soapMule soap
Mule soapPhaniu
 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in muleAnirban Sen Chowdhary
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web servicesShanky Gupta
 
Create dynamic json using mule
Create dynamic json using muleCreate dynamic json using mule
Create dynamic json using muleSon Nguyen
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json mdfkhan625
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json javeed_mhd
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json Mohammed625
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic jsonHasan Syed
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic jsonMohammed246
 
Creating dynamic json in mule
Creating dynamic json in muleCreating dynamic json in mule
Creating dynamic json in mulePraneethchampion
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json Khasim Saheb
 

Similar to Validating soap request in mule (20)

Mule soap
Mule soapMule soap
Mule soap
 
Soap in mule
Soap in muleSoap in mule
Soap in mule
 
Soap validation
Soap validationSoap validation
Soap validation
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule soap
Mule soapMule soap
Mule soap
 
Mule soap
Mule soapMule soap
Mule soap
 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in mule
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
 
Create dynamic json using mule
Create dynamic json using muleCreate dynamic json using mule
Create dynamic json using mule
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
 
Creating dynamic json in mule
Creating dynamic json in muleCreating dynamic json in mule
Creating dynamic json in mule
 
Creating dynamic json
Creating dynamic json Creating dynamic json
Creating dynamic json
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
 
Creating dynamic json
Creating dynamic jsonCreating dynamic json
Creating dynamic json
 

More from javeed_mhd

For each component in mule
For each component in muleFor each component in mule
For each component in mulejaveed_mhd
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mulejaveed_mhd
 
File component in mule
File component in muleFile component in mule
File component in mulejaveed_mhd
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mulejaveed_mhd
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mulejaveed_mhd
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mulejaveed_mhd
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mulejaveed_mhd
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mulejaveed_mhd
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation javeed_mhd
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy javeed_mhd
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mulejaveed_mhd
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint javeed_mhd
 
How to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudioHow to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudiojaveed_mhd
 
Mapping and listing with mule
Mapping and listing with mule Mapping and listing with mule
Mapping and listing with mule javeed_mhd
 
Mule any point exchange
Mule any point exchangeMule any point exchange
Mule any point exchangejaveed_mhd
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer javeed_mhd
 
Mule Maven Plugin
Mule Maven PluginMule Maven Plugin
Mule Maven Pluginjaveed_mhd
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripejaveed_mhd
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedurejaveed_mhd
 

More from javeed_mhd (20)

For each component in mule
For each component in muleFor each component in mule
For each component in mule
 
Filter expression in mule
Filter expression in muleFilter expression in mule
Filter expression in mule
 
File component in mule
File component in muleFile component in mule
File component in mule
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Choice component in mule
Choice component in muleChoice component in mule
Choice component in mule
 
Vm component in mule
Vm component in muleVm component in mule
Vm component in mule
 
Until successful component in mule
Until successful component in muleUntil successful component in mule
Until successful component in mule
 
Quartz component in mule
Quartz component in muleQuartz component in mule
Quartz component in mule
 
Mule management console installation
Mule management console installation Mule management console installation
Mule management console installation
 
Mule esb made system integration easy
Mule esb made system integration easy Mule esb made system integration easy
Mule esb made system integration easy
 
Message properties component in mule
Message properties component in muleMessage properties component in mule
Message properties component in mule
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint How to install sonarqube plugin in anypoint
How to install sonarqube plugin in anypoint
 
How to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudioHow to commit a project in svn using svn plugin in anypointstudio
How to commit a project in svn using svn plugin in anypointstudio
 
Mapping and listing with mule
Mapping and listing with mule Mapping and listing with mule
Mapping and listing with mule
 
Mule any point exchange
Mule any point exchangeMule any point exchange
Mule any point exchange
 
Mule esb api layer
Mule esb api layer Mule esb api layer
Mule esb api layer
 
Mule Maven Plugin
Mule Maven PluginMule Maven Plugin
Mule Maven Plugin
 
Mule esb stripe
Mule esb stripeMule esb stripe
Mule esb stripe
 
Mule with stored procedure
Mule with stored procedureMule with stored procedure
Mule with stored procedure
 

Recently uploaded

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

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