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 a soap request in mule

More Related Content

PPTX
Mule soap
Khasim Saheb
 
PPTX
Filtering jms messages with mule
Anirban Sen Chowdhary
 
PPTX
Soap in mule
D.Rajesh Kumar
 
PPTX
Validating a soap request in mule
Anirban Sen Chowdhary
 
PPTX
Accessing jms in mule using groovy
Anirban Sen Chowdhary
 
PPTX
Validate Soap Request in Mule
irfan1008
 
PPTX
Validate soap request in mule
Mohammed246
 
PPTX
Creating dynamic json
Anirban Sen Chowdhary
 
Mule soap
Khasim Saheb
 
Filtering jms messages with mule
Anirban Sen Chowdhary
 
Soap in mule
D.Rajesh Kumar
 
Validating a soap request in mule
Anirban Sen Chowdhary
 
Accessing jms in mule using groovy
Anirban Sen Chowdhary
 
Validate Soap Request in Mule
irfan1008
 
Validate soap request in mule
Mohammed246
 
Creating dynamic json
Anirban Sen Chowdhary
 

What's hot (9)

PPTX
Soap In Mule
Bui Kiet
 
PPTX
Mule soap
D.Rajesh Kumar
 
PPTX
Soap request in mule
Praneethchampion
 
PPT
Mule and web services
Prabhat gangwar
 
PPTX
VM example in mule
Anirban Sen Chowdhary
 
PPTX
Creating dynamic json in Mule
F K
 
PPTX
Simple web service vm
Mohammed246
 
PPTX
Send email attachment using smtp in mule esb
RaviShankar Mishra
 
PPTX
Web service vm in mule
Mohammed246
 
Soap In Mule
Bui Kiet
 
Mule soap
D.Rajesh Kumar
 
Soap request in mule
Praneethchampion
 
Mule and web services
Prabhat gangwar
 
VM example in mule
Anirban Sen Chowdhary
 
Creating dynamic json in Mule
F K
 
Simple web service vm
Mohammed246
 
Send email attachment using smtp in mule esb
RaviShankar Mishra
 
Web service vm in mule
Mohammed246
 
Ad

Similar to Validating a 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 Rajkattamuri (20)

PPTX
Github plugin setup in anypointstudio
Rajkattamuri
 
PPTX
For each component in mule
Rajkattamuri
 
PPTX
Filter expression in mule
Rajkattamuri
 
PPTX
File component in mule
Rajkattamuri
 
PPTX
Database component in mule
Rajkattamuri
 
PPTX
Choice component in mule
Rajkattamuri
 
PPT
WebServices
Rajkattamuri
 
PPTX
Java Basics in Mule
Rajkattamuri
 
PPTX
WebServices Basic Overview
Rajkattamuri
 
PPTX
Java For Begineers
Rajkattamuri
 
PPT
Java Basics
Rajkattamuri
 
PPT
WebServices Basics
Rajkattamuri
 
PPT
Core java
Rajkattamuri
 
PPT
WebServices SOAP WSDL and UDDI
Rajkattamuri
 
PPTX
Web services soap
Rajkattamuri
 
PPTX
Web services wsdl
Rajkattamuri
 
PPTX
Web services uddi
Rajkattamuri
 
PPT
Maven
Rajkattamuri
 
PPTX
Mule esb dataweave
Rajkattamuri
 
PPTX
Mule with drools
Rajkattamuri
 
Github plugin setup in anypointstudio
Rajkattamuri
 
For each component in mule
Rajkattamuri
 
Filter expression in mule
Rajkattamuri
 
File component in mule
Rajkattamuri
 
Database component in mule
Rajkattamuri
 
Choice component in mule
Rajkattamuri
 
WebServices
Rajkattamuri
 
Java Basics in Mule
Rajkattamuri
 
WebServices Basic Overview
Rajkattamuri
 
Java For Begineers
Rajkattamuri
 
Java Basics
Rajkattamuri
 
WebServices Basics
Rajkattamuri
 
Core java
Rajkattamuri
 
WebServices SOAP WSDL and UDDI
Rajkattamuri
 
Web services soap
Rajkattamuri
 
Web services wsdl
Rajkattamuri
 
Web services uddi
Rajkattamuri
 
Mule esb dataweave
Rajkattamuri
 
Mule with drools
Rajkattamuri
 

Recently uploaded (20)

PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Software Development Methodologies in 2025
KodekX
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 

Validating a 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