SlideShare a Scribd company logo
1 of 19
CONSUMING SOAP WEB SERVICE
- MULESOFT CXF JAX-WS-CLIENT MODULE
Vince Jason Soliza
Mulesoft CXF Jax-WS Client Module
When using CXF inside of Mule, there are
several different ways to consume web service.
One is the WSDL First CXF JAX-WS Client: It
builds a message processor which can use a JAX-
WS client generated from WSDL.
JAX-WS-CLIENT
WSDL / CONTRACT FIRST APPROACH
Create Stub Client with CXF: wsdl2java
First we need to setup our maven configuration to create a stub client.
CXF includes the wsdl2java utility that can generate Java stub client code to
call any method on the service, and marshal and un-marshal request
parameters and responses as Java objects for further processing. This
generated stub client is the core of your connector.
Create Stub Client with CXF: wsdl2java
The Java source files generated correspond to the service as described by
the contents of the WSDL.
Create 2 Flows:
Main Flow & CXF Client Flow
Main Flow Components
• HTTP Listener
– Accepts the request
• Transform Message
– Create request for web service consumer the output is XML
• XML-to-JAXB-Object
– Transform XML to JAXB-Object to be consumed by the JAX-WS-Client
• Flow Reference
– Reference to the Flow of EchoServiceFlow
• Transform Message
– Parse the response of EchoServiceFlow to XML
CXF Client Components
• CXF
– Jax-ws-client configuration
• HTTP request
– http request hold the configuration for the target endpoint
Request Configuration
We used Transform Message to create a SOAP request, cxf:jax-ws-client
requires jaxb-object as the acceptable request so we added xml-to-jaxb-
object transformer after it.
Request Configuration
Check in debug mode, the payload is an instance of EchoRequest.
Request Configuration
Code Snippet:
<dw:transform-message doc:name="Transform Message">
<dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace echo http://www.whiteskylabs.com/wsdl/echo/
---
echo#EchoRequest: {
EchoInfo: {
Id: "1345",
Name: "Mario Luigi",
Description: "Mario Bros",
OtherInfo: "Legendary"
}
}
]]></dw:set-payload>
</dw:transform-message>
<mulexml:jaxb-xml-to-object-transformer
returnClass="com.whiteskylabs.wsdl.echo.EchoRequest" jaxbContext-
ref="JAXB_Context"
doc:name="XML to JAXB Object" />
cxf:jax-ws-client Configuration
Configure the client with the following properties.
• clientClass: The client class generated by CXF, which extends
javax.xml.ws.Service.
• port: The WSDL port to use for communicating with the service
• wsdlLocation: The location of the WSDL for the service. Since we are
using WSDL first client, CXF uses this to configure the client.
• operation: The operation name to invoke on the web service.
cxf:jax-ws-client Configuration
We put cxf:jax-ws-client into a new private flow, to wrap it as a SOAP web
service consumer.
code snippet:
<flow name="EchoServiceFlow">
<cxf:jaxws-client operation="echo"
clientClass="com.whiteskylabs.wsdl.echo.EchoService_Service"
port="EchoServicePort"
wsdlLocation="classpath:/EchoService.wsdl" doc:name="CXF"
soapVersion="1.2" />
<http:request config-ref="HTTP_Request_Configuration"
path="/echo-ws/ws/EchoService" method="POST" doc:name="HTTP" />
</flow>
Response Configuration
The cxf:jax-ws-client response is also an object, but unlike with request it’s
not in the form of JAXB-Object. We can directly use the Transform Message to
parse it and create an XML response.
Response Configuration
Check in debug mode, the payload is an instance of EchoResponse.
Response Configuration
code snippet:
<dw:transform-message doc:name="Transform Message">
<dw:set-payload><![CDATA[%dw 1.0
%output application/xml
%namespace echo http://com.whiteskylabs/wsdl/echo/
---
{
echo#EchoResponse: {
echoResult: {
echoInfo: {
id: payload.echoResult.echoInfo.id,
name: payload.echoResult.echoInfo.name,
description:
payload.echoResult.echoInfo.description,
otherInfo: payload.echoResult.echoInfo.otherInfo
}
}
}
}]]></dw:set-payload>
</dw:transform-message>
Test the application
• Run the application in Anypoint Studio.
• Send request through HTTP using Postman, browser or any client you
prefer.
• We can see in the screenshot below, the response of the soap web service
we consumed using web service consumer.
Summary
This slide describes how to consume web
services using the CXF jax-ws-client message
processor using WSDL first approach.
It is still recommended to use the Web Service
Consumer component instead of this whenever
possible.
QUESTIONS?
Please leave a comment 

More Related Content

What's hot

Mulesoft file connector
Mulesoft file connectorMulesoft file connector
Mulesoft file connectorkumar gaurav
 
Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demoSudha Ch
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esbPraneethchampion
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notificationsShanky Gupta
 
Introduction to es bs mule
Introduction to es bs   muleIntroduction to es bs   mule
Introduction to es bs muleAchyuta Lakshmi
 
Enjoy Munit with Mule
Enjoy Munit with MuleEnjoy Munit with Mule
Enjoy Munit with MuleBui Kiet
 
Mule jms queues
Mule jms queuesMule jms queues
Mule jms queuesGandham38
 
Database component in mule
Database component in muleDatabase component in mule
Database component in muleRajkattamuri
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introductionSon Nguyen
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data WeaveMohammed246
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demoSudha Ch
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core conceptsSindhu VL
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
Mule esb
Mule esbMule esb
Mule esbKhan625
 

What's hot (20)

Mule soap
Mule soapMule soap
Mule soap
 
Mulesoft file connector
Mulesoft file connectorMulesoft file connector
Mulesoft file connector
 
Database component in mule demo
Database component in mule demoDatabase component in mule demo
Database component in mule demo
 
Send email attachment using smtp in mule esb
Send email attachment using smtp in mule esbSend email attachment using smtp in mule esb
Send email attachment using smtp in mule esb
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notifications
 
Introduction to es bs mule
Introduction to es bs   muleIntroduction to es bs   mule
Introduction to es bs mule
 
Enjoy Munit with Mule
Enjoy Munit with MuleEnjoy Munit with Mule
Enjoy Munit with Mule
 
Mule jms queues
Mule jms queuesMule jms queues
Mule jms queues
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Mule jdbc
Mule   jdbcMule   jdbc
Mule jdbc
 
Mule enterprise service introduction
Mule enterprise service introductionMule enterprise service introduction
Mule enterprise service introduction
 
Mule Esb Data Weave
Mule Esb Data WeaveMule Esb Data Weave
Mule Esb Data Weave
 
For each component in mule demo
For each component in mule demoFor each component in mule demo
For each component in mule demo
 
Mule Ajax Connector
Mule Ajax ConnectorMule Ajax Connector
Mule Ajax Connector
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core concepts
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule esb
Mule esbMule esb
Mule esb
 
How to connect redis and mule esb using spring data redis module
How to connect redis and mule esb using spring data redis moduleHow to connect redis and mule esb using spring data redis module
How to connect redis and mule esb using spring data redis module
 
Soap in mule
Soap in muleSoap in mule
Soap in mule
 

Viewers also liked

MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
MuleSoft Consuming Soap Web Service - CXF Proxy-Client ModuleMuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
MuleSoft Consuming Soap Web Service - CXF Proxy-Client ModuleVince Soliza
 
Mulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerMulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerVince Soliza
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITCarol McDonald
 
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
Mulesoft Salesforce Connector -  OAuth 2.0 JWT BearerMulesoft Salesforce Connector -  OAuth 2.0 JWT Bearer
Mulesoft Salesforce Connector - OAuth 2.0 JWT BearerVince Soliza
 
Apply Rate Limiting Policy
Apply Rate Limiting Policy Apply Rate Limiting Policy
Apply Rate Limiting Policy Vince Soliza
 
Anypoint platform for api
Anypoint platform for apiAnypoint platform for api
Anypoint platform for apiVince Soliza
 
Rate Limiting - SLA Based Policy
Rate Limiting - SLA Based PolicyRate Limiting - SLA Based Policy
Rate Limiting - SLA Based PolicyVince Soliza
 
API Proxy Auto Discovery
API Proxy Auto DiscoveryAPI Proxy Auto Discovery
API Proxy Auto DiscoveryVince Soliza
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web servicesShanky Gupta
 
SOAP To REST API Proxy
SOAP To REST API ProxySOAP To REST API Proxy
SOAP To REST API ProxyVince Soliza
 
ESB Online Training Part 2
ESB Online Training Part 2ESB Online Training Part 2
ESB Online Training Part 2Vince Soliza
 

Viewers also liked (12)

MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
MuleSoft Consuming Soap Web Service - CXF Proxy-Client ModuleMuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
 
Mulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service ConsumerMulesoft Consuming Web Service - Web Service Consumer
Mulesoft Consuming Web Service - Web Service Consumer
 
Interoperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSITInteroperable Web Services with JAX-WS and WSIT
Interoperable Web Services with JAX-WS and WSIT
 
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
Mulesoft Salesforce Connector -  OAuth 2.0 JWT BearerMulesoft Salesforce Connector -  OAuth 2.0 JWT Bearer
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
 
Apply Rate Limiting Policy
Apply Rate Limiting Policy Apply Rate Limiting Policy
Apply Rate Limiting Policy
 
Anypoint platform for api
Anypoint platform for apiAnypoint platform for api
Anypoint platform for api
 
Rate Limiting - SLA Based Policy
Rate Limiting - SLA Based PolicyRate Limiting - SLA Based Policy
Rate Limiting - SLA Based Policy
 
API Proxy Auto Discovery
API Proxy Auto DiscoveryAPI Proxy Auto Discovery
API Proxy Auto Discovery
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
 
SOAP To REST API Proxy
SOAP To REST API ProxySOAP To REST API Proxy
SOAP To REST API Proxy
 
Mule esb examples
Mule esb examplesMule esb examples
Mule esb examples
 
ESB Online Training Part 2
ESB Online Training Part 2ESB Online Training Part 2
ESB Online Training Part 2
 

Similar to MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module

Web services in java
Web services in javaWeb services in java
Web services in javamaabujji
 
Connect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket PipelinesConnect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket PipelinesAtlassian
 
Mulesoft Soap Service
Mulesoft Soap ServiceMulesoft Soap Service
Mulesoft Soap ServiceUjjawal Kant
 
Web service through cxf
Web service through cxfWeb service through cxf
Web service through cxfRoger Xia
 
Working with PowerVC via its REST APIs
Working with PowerVC via its REST APIsWorking with PowerVC via its REST APIs
Working with PowerVC via its REST APIsJoe Cropper
 
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQLBuilding a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQLScyllaDB
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-serviceshomeworkping3
 
Introducing dwr (direct web remoting)
Introducing dwr (direct web remoting)Introducing dwr (direct web remoting)
Introducing dwr (direct web remoting)Ashish Boobun
 
Event streaming webinar feb 2020
Event streaming webinar feb 2020Event streaming webinar feb 2020
Event streaming webinar feb 2020Maheedhar Gunturu
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 

Similar to MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module (20)

Mule soft ppt 2
Mule soft ppt  2Mule soft ppt  2
Mule soft ppt 2
 
Web services in java
Web services in javaWeb services in java
Web services in java
 
Web Services
Web Services Web Services
Web Services
 
Steps india technologies
Steps india technologiesSteps india technologies
Steps india technologies
 
Steps india technologies .com
Steps india technologies .comSteps india technologies .com
Steps india technologies .com
 
Connect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket PipelinesConnect + Docker + AWS = Bitbucket Pipelines
Connect + Docker + AWS = Bitbucket Pipelines
 
Mule and web services
Mule and web servicesMule and web services
Mule and web services
 
Web services
Web servicesWeb services
Web services
 
Mulesoft Soap Service
Mulesoft Soap ServiceMulesoft Soap Service
Mulesoft Soap Service
 
Web service through cxf
Web service through cxfWeb service through cxf
Web service through cxf
 
Working with PowerVC via its REST APIs
Working with PowerVC via its REST APIsWorking with PowerVC via its REST APIs
Working with PowerVC via its REST APIs
 
11-DWR-and-JQuery
11-DWR-and-JQuery11-DWR-and-JQuery
11-DWR-and-JQuery
 
11-DWR-and-JQuery
11-DWR-and-JQuery11-DWR-and-JQuery
11-DWR-and-JQuery
 
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQLBuilding a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
Building a Real-time Streaming ETL Framework Using ksqlDB and NoSQL
 
58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services58615764 net-and-j2 ee-web-services
58615764 net-and-j2 ee-web-services
 
Web service introduction
Web service introductionWeb service introduction
Web service introduction
 
Introducing dwr (direct web remoting)
Introducing dwr (direct web remoting)Introducing dwr (direct web remoting)
Introducing dwr (direct web remoting)
 
Web services overview
Web services overviewWeb services overview
Web services overview
 
Event streaming webinar feb 2020
Event streaming webinar feb 2020Event streaming webinar feb 2020
Event streaming webinar feb 2020
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 

Recently uploaded

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module

  • 1. CONSUMING SOAP WEB SERVICE - MULESOFT CXF JAX-WS-CLIENT MODULE Vince Jason Soliza
  • 2. Mulesoft CXF Jax-WS Client Module When using CXF inside of Mule, there are several different ways to consume web service. One is the WSDL First CXF JAX-WS Client: It builds a message processor which can use a JAX- WS client generated from WSDL.
  • 4. Create Stub Client with CXF: wsdl2java First we need to setup our maven configuration to create a stub client. CXF includes the wsdl2java utility that can generate Java stub client code to call any method on the service, and marshal and un-marshal request parameters and responses as Java objects for further processing. This generated stub client is the core of your connector.
  • 5. Create Stub Client with CXF: wsdl2java The Java source files generated correspond to the service as described by the contents of the WSDL.
  • 6. Create 2 Flows: Main Flow & CXF Client Flow
  • 7. Main Flow Components • HTTP Listener – Accepts the request • Transform Message – Create request for web service consumer the output is XML • XML-to-JAXB-Object – Transform XML to JAXB-Object to be consumed by the JAX-WS-Client • Flow Reference – Reference to the Flow of EchoServiceFlow • Transform Message – Parse the response of EchoServiceFlow to XML
  • 8. CXF Client Components • CXF – Jax-ws-client configuration • HTTP request – http request hold the configuration for the target endpoint
  • 9. Request Configuration We used Transform Message to create a SOAP request, cxf:jax-ws-client requires jaxb-object as the acceptable request so we added xml-to-jaxb- object transformer after it.
  • 10. Request Configuration Check in debug mode, the payload is an instance of EchoRequest.
  • 11. Request Configuration Code Snippet: <dw:transform-message doc:name="Transform Message"> <dw:set-payload><![CDATA[%dw 1.0 %output application/xml %namespace echo http://www.whiteskylabs.com/wsdl/echo/ --- echo#EchoRequest: { EchoInfo: { Id: "1345", Name: "Mario Luigi", Description: "Mario Bros", OtherInfo: "Legendary" } } ]]></dw:set-payload> </dw:transform-message> <mulexml:jaxb-xml-to-object-transformer returnClass="com.whiteskylabs.wsdl.echo.EchoRequest" jaxbContext- ref="JAXB_Context" doc:name="XML to JAXB Object" />
  • 12. cxf:jax-ws-client Configuration Configure the client with the following properties. • clientClass: The client class generated by CXF, which extends javax.xml.ws.Service. • port: The WSDL port to use for communicating with the service • wsdlLocation: The location of the WSDL for the service. Since we are using WSDL first client, CXF uses this to configure the client. • operation: The operation name to invoke on the web service.
  • 13. cxf:jax-ws-client Configuration We put cxf:jax-ws-client into a new private flow, to wrap it as a SOAP web service consumer. code snippet: <flow name="EchoServiceFlow"> <cxf:jaxws-client operation="echo" clientClass="com.whiteskylabs.wsdl.echo.EchoService_Service" port="EchoServicePort" wsdlLocation="classpath:/EchoService.wsdl" doc:name="CXF" soapVersion="1.2" /> <http:request config-ref="HTTP_Request_Configuration" path="/echo-ws/ws/EchoService" method="POST" doc:name="HTTP" /> </flow>
  • 14. Response Configuration The cxf:jax-ws-client response is also an object, but unlike with request it’s not in the form of JAXB-Object. We can directly use the Transform Message to parse it and create an XML response.
  • 15. Response Configuration Check in debug mode, the payload is an instance of EchoResponse.
  • 16. Response Configuration code snippet: <dw:transform-message doc:name="Transform Message"> <dw:set-payload><![CDATA[%dw 1.0 %output application/xml %namespace echo http://com.whiteskylabs/wsdl/echo/ --- { echo#EchoResponse: { echoResult: { echoInfo: { id: payload.echoResult.echoInfo.id, name: payload.echoResult.echoInfo.name, description: payload.echoResult.echoInfo.description, otherInfo: payload.echoResult.echoInfo.otherInfo } } } }]]></dw:set-payload> </dw:transform-message>
  • 17. Test the application • Run the application in Anypoint Studio. • Send request through HTTP using Postman, browser or any client you prefer. • We can see in the screenshot below, the response of the soap web service we consumed using web service consumer.
  • 18. Summary This slide describes how to consume web services using the CXF jax-ws-client message processor using WSDL first approach. It is still recommended to use the Web Service Consumer component instead of this whenever possible.

Editor's Notes

  1. This template can be used as a starter file for presenting training materials in a group setting. Sections Sections can help to organize your slides or facilitate collaboration between multiple authors. On the Home tab under Slides, click Section, and then click Add Section. Notes Use the Notes pane for delivery notes or to provide additional details for the audience. You can see these notes in Presenter View during your presentation. Keep in mind the font size (important for accessibility, visibility, videotaping, and online production) Coordinated colors Pay particular attention to the graphs, charts, and text boxes. Consider that attendees will print in black and white or grayscale. Run a test print to make sure your colors work when printed in pure black and white and grayscale. Graphics, tables, and graphs Keep it simple: If possible, use consistent, non-distracting styles and colors. Label all graphs and tables.
  2. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  3. This template can be used as a starter file for presenting training materials in a group setting. Sections Sections can help to organize your slides or facilitate collaboration between multiple authors. On the Home tab under Slides, click Section, and then click Add Section. Notes Use the Notes pane for delivery notes or to provide additional details for the audience. You can see these notes in Presenter View during your presentation. Keep in mind the font size (important for accessibility, visibility, videotaping, and online production) Coordinated colors Pay particular attention to the graphs, charts, and text boxes. Consider that attendees will print in black and white or grayscale. Run a test print to make sure your colors work when printed in pure black and white and grayscale. Graphics, tables, and graphs Keep it simple: If possible, use consistent, non-distracting styles and colors. Label all graphs and tables.
  4. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  5. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  6. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  7. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  8. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  9. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  10. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  11. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  12. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  13. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  14. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  15. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  16. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  17. Give a brief overview of the presentation. Describe the major focus of the presentation and why it is important. Introduce each of the major topics. To provide a road map for the audience, you can repeat this Overview slide throughout the presentation, highlighting the particular topic you will discuss next.
  18. Summarize presentation content by restating the important points from the lessons. What do you want the audience to remember when they leave your presentation?
  19. Microsoft Confidential