SlideShare a Scribd company logo
1 of 12
SOAP VALIDATION
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.
.
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.MAIND
ATA" DOC:NAME="SOAP"/>
<COMPONENT
CLASS="COM.TEST.SERVICES.SCHEMA.MAINDATA.V1.IMPL.MAINDAT
AIMPL" 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

More Related Content

Viewers also liked

managed-services-buying-guide
managed-services-buying-guidemanaged-services-buying-guide
managed-services-buying-guide
Marie Peters
 

Viewers also liked (17)

Quartz in mule
Quartz in muleQuartz in mule
Quartz in mule
 
The routing message processor scatter gather
The routing message processor scatter gatherThe routing message processor scatter gather
The routing message processor scatter gather
 
Jesusmata hardware.ppt
Jesusmata hardware.pptJesusmata hardware.ppt
Jesusmata hardware.ppt
 
Robo de identidad y seguridad informatica
Robo de identidad y seguridad informaticaRobo de identidad y seguridad informatica
Robo de identidad y seguridad informatica
 
Neurotransmisores
NeurotransmisoresNeurotransmisores
Neurotransmisores
 
Actividad Integradora Ser o no ser Social
Actividad Integradora Ser o no ser SocialActividad Integradora Ser o no ser Social
Actividad Integradora Ser o no ser Social
 
Diabetes gestacional who 2013
Diabetes gestacional who 2013Diabetes gestacional who 2013
Diabetes gestacional who 2013
 
Digging github
Digging githubDigging github
Digging github
 
Flow measurement
Flow measurementFlow measurement
Flow measurement
 
Tumores oseos
Tumores oseosTumores oseos
Tumores oseos
 
Korean drama
Korean dramaKorean drama
Korean drama
 
Robo de identidad y seguridad informatica
Robo de identidad y seguridad informaticaRobo de identidad y seguridad informatica
Robo de identidad y seguridad informatica
 
Neurotransmisores y sus aplicaciones en la psicologia
Neurotransmisores y sus aplicaciones en la psicologiaNeurotransmisores y sus aplicaciones en la psicologia
Neurotransmisores y sus aplicaciones en la psicologia
 
Gaussjordan
GaussjordanGaussjordan
Gaussjordan
 
Edgar
EdgarEdgar
Edgar
 
Derecho Romano - Sesion y garantia derechos de credito
Derecho Romano - Sesion y garantia derechos de creditoDerecho Romano - Sesion y garantia derechos de credito
Derecho Romano - Sesion y garantia derechos de credito
 
managed-services-buying-guide
managed-services-buying-guidemanaged-services-buying-guide
managed-services-buying-guide
 

Similar to Soap validation

Similar to Soap validation (20)

Soap in mule
Soap in muleSoap in mule
Soap in mule
 
Soap in mule
Soap in muleSoap in mule
Soap in mule
 
Soap In Mule
Soap In MuleSoap In Mule
Soap In Mule
 
Mule soap
Mule soapMule soap
Mule soap
 
Validate Soap Request in Mule
Validate Soap Request in MuleValidate Soap Request in Mule
Validate Soap Request 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
 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a 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
 
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
 
Mule soap
Mule soapMule soap
Mule soap
 
Validating a soap request in mule
Validating a soap request in muleValidating a soap request in mule
Validating a soap request in mule
 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in mule
 

More from Son Nguyen

More from Son Nguyen (20)

Wsdl connector introduction
Wsdl connector introductionWsdl connector introduction
Wsdl connector introduction
 
Android intergrate with mule
Android intergrate with muleAndroid intergrate with mule
Android intergrate with mule
 
Mule flow overview
Mule flow overviewMule flow overview
Mule flow overview
 
Mule flow and filter
Mule flow and filterMule flow and filter
Mule flow and filter
 
Handle exceptions in mule
Handle exceptions in muleHandle exceptions in mule
Handle exceptions in mule
 
Spring security integrate with mule
Spring security integrate with muleSpring security integrate with mule
Spring security integrate with mule
 
Message processor in mule
Message processor in muleMessage processor in mule
Message processor in mule
 
Expression language in mule
Expression language in muleExpression language in mule
Expression language in mule
 
Mule with data weave
Mule with data weaveMule with data weave
Mule with data weave
 
Using spring scheduler mule
Using spring scheduler muleUsing spring scheduler mule
Using spring scheduler mule
 
Composite source in bound and out-bound
Composite source in bound and out-boundComposite source in bound and out-bound
Composite source in bound and out-bound
 
Batch job processing
Batch job processingBatch job processing
Batch job processing
 
Using message enricher
Using message enricherUsing message enricher
Using message enricher
 
Finance connectors with mule
Finance connectors with muleFinance connectors with mule
Finance connectors with mule
 
Google drive connection
Google drive connectionGoogle drive connection
Google drive connection
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
Mule integrate with microsoft
Mule integrate with microsoftMule integrate with microsoft
Mule integrate with microsoft
 
Jms queue
Jms queueJms queue
Jms queue
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Mule esb basic introduction
Mule esb basic introductionMule esb basic introduction
Mule esb basic introduction
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

Soap validation

  • 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. 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..
  • 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.MAIND ATA" DOC:NAME="SOAP"/> <COMPONENT CLASS="COM.TEST.SERVICES.SCHEMA.MAINDATA.V1.IMPL.MAINDAT AIMPL" 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