SlideShare a Scribd company logo
1 of 13
A U T H O R : K I E T B U I
SOAP USAGE 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 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..
Yes, I am talking about using message filter to validate a
SOAP request against a given XSD file
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/Sch
ema+Validation+Filter
Validate SOAP Requests with XSD in Mule

More Related Content

What's hot

Creating dynamic json in Mule
Creating dynamic json in MuleCreating dynamic json in Mule
Creating dynamic json in MuleF K
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in muleMohammed246
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in MuleKhasim Saheb
 

What's hot (6)

Creating dynamic json in Mule
Creating dynamic json in MuleCreating dynamic json in Mule
Creating dynamic json in Mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Spicing your mule response
Spicing your mule responseSpicing your mule response
Spicing your mule response
 
Mule and web services
Mule and web servicesMule and web services
Mule and web services
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
 

Viewers also liked

Clase 02 - Curso Hacker Ético
Clase 02 - Curso Hacker ÉticoClase 02 - Curso Hacker Ético
Clase 02 - Curso Hacker ÉticoFranciny Salles
 
Decisão tomás figueiredo
Decisão tomás figueiredoDecisão tomás figueiredo
Decisão tomás figueiredoThiago Rodrigues
 
German fighter production in ww two
German fighter production in ww twoGerman fighter production in ww two
German fighter production in ww twoNenad Pavlovic
 
Мониторинг битумных кровельных материалов (мастики и праймеры) 2013
Мониторинг битумных кровельных материалов (мастики и праймеры) 2013Мониторинг битумных кровельных материалов (мастики и праймеры) 2013
Мониторинг битумных кровельных материалов (мастики и праймеры) 2013Agency of Industrial Marketing
 
Исследование украинского рынка охранных услуг (Часть 2)
Исследование украинского рынка охранных услуг (Часть 2)Исследование украинского рынка охранных услуг (Часть 2)
Исследование украинского рынка охранных услуг (Часть 2)Agency of Industrial Marketing
 
Musk Ox Burger Recipe for Northern Flyer
Musk Ox Burger Recipe for Northern FlyerMusk Ox Burger Recipe for Northern Flyer
Musk Ox Burger Recipe for Northern FlyerTwyla Campbell
 
Fonebell - Tailored call center software solutions.
Fonebell - Tailored call center software solutions. Fonebell - Tailored call center software solutions.
Fonebell - Tailored call center software solutions. adam anderson
 
Freelancing for Beginner
Freelancing for Beginner Freelancing for Beginner
Freelancing for Beginner Harun Rashid
 
Мониторинг рынка плоского стекла
Мониторинг рынка плоского стеклаМониторинг рынка плоского стекла
Мониторинг рынка плоского стеклаAgency of Industrial Marketing
 
Chicago's office buildings are casting a long shadow
Chicago's office buildings are casting a long shadowChicago's office buildings are casting a long shadow
Chicago's office buildings are casting a long shadowHailey Harrington
 
Trends in K-12 Educational Technology
Trends in K-12 Educational TechnologyTrends in K-12 Educational Technology
Trends in K-12 Educational TechnologyE Robertson
 
Acompanhamento processual da justiça eleitoral
Acompanhamento processual da justiça eleitoral  Acompanhamento processual da justiça eleitoral
Acompanhamento processual da justiça eleitoral Akibas De Freitas Souza
 
Arc251 02 the-scope-of-urban-design
Arc251 02 the-scope-of-urban-designArc251 02 the-scope-of-urban-design
Arc251 02 the-scope-of-urban-designShivani Gupta
 
ACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANO
ACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANOACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANO
ACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANOmorochamarijo
 

Viewers also liked (20)

Clase 02 - Curso Hacker Ético
Clase 02 - Curso Hacker ÉticoClase 02 - Curso Hacker Ético
Clase 02 - Curso Hacker Ético
 
Tributario actividad 9
Tributario actividad 9Tributario actividad 9
Tributario actividad 9
 
Decisão tomás figueiredo
Decisão tomás figueiredoDecisão tomás figueiredo
Decisão tomás figueiredo
 
German fighter production in ww two
German fighter production in ww twoGerman fighter production in ww two
German fighter production in ww two
 
Мониторинг битумных кровельных материалов (мастики и праймеры) 2013
Мониторинг битумных кровельных материалов (мастики и праймеры) 2013Мониторинг битумных кровельных материалов (мастики и праймеры) 2013
Мониторинг битумных кровельных материалов (мастики и праймеры) 2013
 
Исследование украинского рынка охранных услуг (Часть 2)
Исследование украинского рынка охранных услуг (Часть 2)Исследование украинского рынка охранных услуг (Часть 2)
Исследование украинского рынка охранных услуг (Часть 2)
 
Musk Ox Burger Recipe for Northern Flyer
Musk Ox Burger Recipe for Northern FlyerMusk Ox Burger Recipe for Northern Flyer
Musk Ox Burger Recipe for Northern Flyer
 
Fonebell - Tailored call center software solutions.
Fonebell - Tailored call center software solutions. Fonebell - Tailored call center software solutions.
Fonebell - Tailored call center software solutions.
 
Freelancing for Beginner
Freelancing for Beginner Freelancing for Beginner
Freelancing for Beginner
 
Мониторинг рынка плоского стекла
Мониторинг рынка плоского стеклаМониторинг рынка плоского стекла
Мониторинг рынка плоского стекла
 
Chicago's office buildings are casting a long shadow
Chicago's office buildings are casting a long shadowChicago's office buildings are casting a long shadow
Chicago's office buildings are casting a long shadow
 
Trends in K-12 Educational Technology
Trends in K-12 Educational TechnologyTrends in K-12 Educational Technology
Trends in K-12 Educational Technology
 
Lesson Proper
Lesson ProperLesson Proper
Lesson Proper
 
Insulation Market Segment Monitoring (2012)
Insulation Market Segment Monitoring (2012)Insulation Market Segment Monitoring (2012)
Insulation Market Segment Monitoring (2012)
 
Derecho Concursal
Derecho ConcursalDerecho Concursal
Derecho Concursal
 
Acompanhamento processual da justiça eleitoral
Acompanhamento processual da justiça eleitoral  Acompanhamento processual da justiça eleitoral
Acompanhamento processual da justiça eleitoral
 
Abc
AbcAbc
Abc
 
Arc251 02 the-scope-of-urban-design
Arc251 02 the-scope-of-urban-designArc251 02 the-scope-of-urban-design
Arc251 02 the-scope-of-urban-design
 
ACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANO
ACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANOACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANO
ACTIVIDAD FINANCIERA DEL ESTADO VENEZOLANO
 
Virtual Education
Virtual EducationVirtual Education
Virtual Education
 

Similar to Validate SOAP Requests with XSD in Mule

Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule javeed_mhd
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in muleSunil Komarapu
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in muleHasan Syed
 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in muleKhan625
 
Validating a soap request in mule
Validating a soap request in mule Validating a soap request in mule
Validating a soap request in mule AbdulImrankhan7
 
Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule mdfkhan625
 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in muleRajkattamuri
 
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
 
Web services101
Web services101Web services101
Web services101chaos41
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web servicesShanky Gupta
 

Similar to Validate SOAP Requests with XSD in Mule (20)

Soap in mule
Soap in muleSoap in mule
Soap in mule
 
Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
 
Validate soap request in mule
Validate soap request in muleValidate soap request in mule
Validate soap request in mule
 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in mule
 
Validating a soap request in mule
Validating a soap request in mule Validating a soap request in mule
Validating a soap request in mule
 
Validating soap request in mule
Validating soap request in mule Validating soap request in mule
Validating soap request in mule
 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in mule
 
Mule soap
Mule soapMule soap
Mule soap
 
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
 
Mule soft ppt 3
Mule soft ppt  3Mule soft ppt  3
Mule soft ppt 3
 
Web services101
Web services101Web services101
Web services101
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
 
Using ajax in mule
Using ajax in muleUsing ajax in mule
Using ajax in mule
 

More from Bui Kiet

Asynchronous javascript and xml
Asynchronous javascript and xmlAsynchronous javascript and xml
Asynchronous javascript and xmlBui Kiet
 
Jquery tutorial
Jquery tutorialJquery tutorial
Jquery tutorialBui Kiet
 
Real time data integration best practices and architecture
Real time data integration best practices and architectureReal time data integration best practices and architecture
Real time data integration best practices and architectureBui Kiet
 
Jms introduction
Jms introductionJms introduction
Jms introductionBui Kiet
 
Wso2 in action
Wso2 in actionWso2 in action
Wso2 in actionBui Kiet
 
Easy javascript
Easy javascriptEasy javascript
Easy javascriptBui Kiet
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript TutorialBui Kiet
 
Java basic tutorial
Java basic tutorialJava basic tutorial
Java basic tutorialBui Kiet
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My HeartBui Kiet
 
Technology presentations
Technology presentationsTechnology presentations
Technology presentationsBui Kiet
 
Mule Esb Batch process
Mule Esb Batch processMule Esb Batch process
Mule Esb Batch processBui Kiet
 
Mule solutions for data integration
Mule solutions for data integrationMule solutions for data integration
Mule solutions for data integrationBui Kiet
 
Mulesoft corporate template final
Mulesoft corporate template  final Mulesoft corporate template  final
Mulesoft corporate template final Bui Kiet
 
Biztalk vs mulesoft
Biztalk vs mulesoft Biztalk vs mulesoft
Biztalk vs mulesoft Bui Kiet
 
Mule Sap Integration
Mule Sap IntegrationMule Sap Integration
Mule Sap IntegrationBui Kiet
 
Why Mulesoft ?
Why Mulesoft ?Why Mulesoft ?
Why Mulesoft ?Bui Kiet
 
Mule Integration Simplified
Mule Integration SimplifiedMule Integration Simplified
Mule Integration SimplifiedBui Kiet
 
Enjoy Munit with Mule
Enjoy Munit with MuleEnjoy Munit with Mule
Enjoy Munit with MuleBui Kiet
 
.Net architecture with mule soft
.Net architecture with mule soft.Net architecture with mule soft
.Net architecture with mule softBui Kiet
 

More from Bui Kiet (20)

Asynchronous javascript and xml
Asynchronous javascript and xmlAsynchronous javascript and xml
Asynchronous javascript and xml
 
Jquery tutorial
Jquery tutorialJquery tutorial
Jquery tutorial
 
Real time data integration best practices and architecture
Real time data integration best practices and architectureReal time data integration best practices and architecture
Real time data integration best practices and architecture
 
Jms introduction
Jms introductionJms introduction
Jms introduction
 
Wso2 in action
Wso2 in actionWso2 in action
Wso2 in action
 
Easy javascript
Easy javascriptEasy javascript
Easy javascript
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
Java basic tutorial
Java basic tutorialJava basic tutorial
Java basic tutorial
 
Java Tutorial | My Heart
Java Tutorial | My HeartJava Tutorial | My Heart
Java Tutorial | My Heart
 
Technology presentations
Technology presentationsTechnology presentations
Technology presentations
 
Mule Esb Batch process
Mule Esb Batch processMule Esb Batch process
Mule Esb Batch process
 
Mule solutions for data integration
Mule solutions for data integrationMule solutions for data integration
Mule solutions for data integration
 
Mulesoft corporate template final
Mulesoft corporate template  final Mulesoft corporate template  final
Mulesoft corporate template final
 
Biztalk vs mulesoft
Biztalk vs mulesoft Biztalk vs mulesoft
Biztalk vs mulesoft
 
Mule Sap Integration
Mule Sap IntegrationMule Sap Integration
Mule Sap Integration
 
Why Mulesoft ?
Why Mulesoft ?Why Mulesoft ?
Why Mulesoft ?
 
Mule Integration Simplified
Mule Integration SimplifiedMule Integration Simplified
Mule Integration Simplified
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Enjoy Munit with Mule
Enjoy Munit with MuleEnjoy Munit with Mule
Enjoy Munit with Mule
 
.Net architecture with mule soft
.Net architecture with mule soft.Net architecture with mule soft
.Net architecture with mule soft
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Validate SOAP Requests with XSD in Mule

  • 1. A U T H O R : K I E T B U I SOAP USAGE 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 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.. Yes, I am talking about using message filter to validate a SOAP request against a given XSD file
  • 4. Let’s see how… Let consider we have a SOAP webs ervice exposed in Mule by following way :-
  • 5. 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
  • 6. So after adding schema validation filter in our flow, our flow looks like the following
  • 7. We can also add a subflow which will throw custom message if the SOAP request is invalid as follow :-
  • 8. So, if we test the webservice with a wrong SOAP request in SoapUI we will get a custom message :-
  • 9. This is how the flow works:-
  • 10. <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.
  • 11. <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:-
  • 12. 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/Sch ema+Validation+Filter