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
Soap request in mule

More Related Content

PPTX
Validate Soap Request in Mule
PPTX
Validate soap request in mule
PPTX
Creating dynamic json
PPTX
Validating a soap request in mule
PPTX
Soap in mule
PPTX
Soap In Mule
PPT
Mule and web services
PPTX
Mule soap
Validate Soap Request in Mule
Validate soap request in mule
Creating dynamic json
Validating a soap request in mule
Soap in mule
Soap In Mule
Mule and web services
Mule soap

What's hot (6)

PPTX
Web service vm in mule
PPTX
Mule velocity
PPTX
Simple web service vm
PPTX
Mule soap
PPTX
Filtering jms messages with mule
PPTX
Creating dynamic json in Mule
 
Web service vm in mule
Mule velocity
Simple web service vm
Mule soap
Filtering jms messages with mule
Creating dynamic json in Mule
 
Ad

Viewers also liked (20)

PPTX
Mapping and listing with mule
PPT
Mule real-world-old
PPTX
Webservice vm in mule
PPTX
xslt in mule
PPTX
Groovy in Mule
PPTX
Documantation with mule
PPTX
Creating dynamic json in mule
PDF
CSP Review Report_Final (1)
PPTX
Introduction to mule esb
PDF
Damaging damzelz' no.1
PPTX
Mule quartz
PPT
Anypoint data gateway
PPTX
Mule soap
PPTX
How to use expression filter
PPT
Mule anypoint exchange
PPT
Mule oracle connectors
PPTX
Send email attachment using smtp in mule esb
PPT
Mule batch processing
PPT
Mule security
PPT
Mule google connectors
Mapping and listing with mule
Mule real-world-old
Webservice vm in mule
xslt in mule
Groovy in Mule
Documantation with mule
Creating dynamic json in mule
CSP Review Report_Final (1)
Introduction to mule esb
Damaging damzelz' no.1
Mule quartz
Anypoint data gateway
Mule soap
How to use expression filter
Mule anypoint exchange
Mule oracle connectors
Send email attachment using smtp in mule esb
Mule batch processing
Mule security
Mule google connectors
Ad

Similar to Soap request in mule (20)

PPTX
Mule soap
PPTX
Soap validation
PPTX
Soap in mule
PPTX
Mule soap
PPTX
Mule soap
PPTX
Mule soap
PPTX
Mule soap
PPTX
Schema validation filter (xml schema validation)
PPTX
PPTX
Mulesoft Soap Service
PPTX
Mule SOAP Fault Component
PPTX
Exception handling in mule
PPTX
Mule Schema Validation Filter
PPTX
Playing with cxf interceptor in mule
PPTX
Expose web service
PPTX
Ws security with mule
PPT
Mule introduction
PPTX
Mule ESB Tutorial Part 2
PDF
Global Scale ESB with Mule
PPTX
Mule soft esb – data validation best practices
Mule soap
Soap validation
Soap in mule
Mule soap
Mule soap
Mule soap
Mule soap
Schema validation filter (xml schema validation)
Mulesoft Soap Service
Mule SOAP Fault Component
Exception handling in mule
Mule Schema Validation Filter
Playing with cxf interceptor in mule
Expose web service
Ws security with mule
Mule introduction
Mule ESB Tutorial Part 2
Global Scale ESB with Mule
Mule soft esb – data validation best practices

More from Praneethchampion (14)

PPT
Mule execution
PPTX
PPTX
Mule esb stripe
PPT
Mule security-jaas
PPTX
Mmc rest api user groups
PPTX
Dataweave
PPTX
Mule for each scope header collection
PPT
Mule esb api layer
PPTX
Scatter gather flow in mule
PPTX
Mule rabbitmq
PPTX
Mule drools
PPTX
Mule esb DataWeave
PPTX
Idempotent filter in mule
Mule execution
Mule esb stripe
Mule security-jaas
Mmc rest api user groups
Dataweave
Mule for each scope header collection
Mule esb api layer
Scatter gather flow in mule
Mule rabbitmq
Mule drools
Mule esb DataWeave
Idempotent filter in mule

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
Teaching material agriculture food technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Programs and apps: productivity, graphics, security and other tools
Mobile App Security Testing_ A Comprehensive Guide.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Teaching material agriculture food technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
The AUB Centre for AI in Media Proposal.docx
MYSQL Presentation for SQL database connectivity
Building Integrated photovoltaic BIPV_UPV.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Spectral efficient network and resource selection model in 5G networks
Chapter 3 Spatial Domain Image Processing.pdf
sap open course for s4hana steps from ECC to s4
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...

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