SlideShare a Scribd company logo
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

PPTX
Concepts in mule
PPTX
Mule soap client demo
PPT
Maven introduction in Mule
PPTX
Mule Webservices
PPTX
Mule esb :Data Weave
PPT
Anypoint connectorfor ibm as 400
PPTX
Mule ESB - Mock Salesforce Interface
ODP
Dropbox connector Mule ESB Integration
Concepts in mule
Mule soap client demo
Maven introduction in Mule
Mule Webservices
Mule esb :Data Weave
Anypoint connectorfor ibm as 400
Mule ESB - Mock Salesforce Interface
Dropbox connector Mule ESB Integration

What's hot (20)

PPTX
Mule soap
PPTX
Mulesoft file connector
PPTX
Database component in mule demo
PPTX
Send email attachment using smtp in mule esb
PPTX
Mule agent notifications
PPT
Introduction to es bs mule
PPTX
Enjoy Munit with Mule
PPTX
Mule jms queues
PPTX
Database component in mule
PPTX
Mule jdbc
PPTX
Mule enterprise service introduction
PPTX
Mule Esb Data Weave
PPTX
For each component in mule demo
PPTX
Mule Ajax Connector
PPTX
Mule core concepts
PPTX
Junit in mule demo
PPTX
Mule esb
PPTX
Mule esb
PDF
How to connect redis and mule esb using spring data redis module
PPTX
Soap in mule
Mule soap
Mulesoft file connector
Database component in mule demo
Send email attachment using smtp in mule esb
Mule agent notifications
Introduction to es bs mule
Enjoy Munit with Mule
Mule jms queues
Database component in mule
Mule jdbc
Mule enterprise service introduction
Mule Esb Data Weave
For each component in mule demo
Mule Ajax Connector
Mule core concepts
Junit in mule demo
Mule esb
Mule esb
How to connect redis and mule esb using spring data redis module
Soap in mule
Ad

Viewers also liked (12)

PPTX
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
PPTX
Mulesoft Consuming Web Service - Web Service Consumer
ODP
Interoperable Web Services with JAX-WS and WSIT
PPTX
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
PPTX
Apply Rate Limiting Policy
PPTX
Anypoint platform for api
PPTX
Rate Limiting - SLA Based Policy
PPTX
API Proxy Auto Discovery
PPTX
Using mule with web services
PPTX
SOAP To REST API Proxy
PDF
Mule esb examples
PPTX
ESB Online Training Part 2
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
Mulesoft Consuming Web Service - Web Service Consumer
Interoperable Web Services with JAX-WS and WSIT
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
Apply Rate Limiting Policy
Anypoint platform for api
Rate Limiting - SLA Based Policy
API Proxy Auto Discovery
Using mule with web services
SOAP To REST API Proxy
Mule esb examples
ESB Online Training Part 2
Ad

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

PPTX
Mule soft ppt 2
PPTX
Mule webservices
PPTX
Mule CXF component
DOCX
Web service through cxf
PPT
Web services
PPT
Mule and web services
PPTX
Mule esb soap_service
PPTX
Wsdl connector introduction
PPT
Implementing WebServices with Camel and CXF in ServiceMix
PDF
Steps india technologies .com
PDF
Steps india technologies
DOCX
Web services Concepts
PPTX
Mule esb soap_service
PDF
Exposing Web Service (CXF) With Mule ESB
PPTX
Webservices
PPTX
Webservice Testing
PPTX
Playing with cxf interceptor in mule
PDF
Java web services using JAX-WS
PPT
Mule web services
PPT
WebServices in ServiceMix with CXF
Mule soft ppt 2
Mule webservices
Mule CXF component
Web service through cxf
Web services
Mule and web services
Mule esb soap_service
Wsdl connector introduction
Implementing WebServices with Camel and CXF in ServiceMix
Steps india technologies .com
Steps india technologies
Web services Concepts
Mule esb soap_service
Exposing Web Service (CXF) With Mule ESB
Webservices
Webservice Testing
Playing with cxf interceptor in mule
Java web services using JAX-WS
Mule web services
WebServices in ServiceMix with CXF

Recently uploaded (20)

PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
assetexplorer- product-overview - presentation
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
System and Network Administration Chapter 2
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
history of c programming in notes for students .pptx
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
medical staffing services at VALiNTRY
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Nekopoi APK 2025 free lastest update
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
Operating system designcfffgfgggggggvggggggggg
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Odoo Companies in India – Driving Business Transformation.pdf
assetexplorer- product-overview - presentation
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
System and Network Administration Chapter 2
Internet Downloader Manager (IDM) Crack 6.42 Build 41
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
2025 Textile ERP Trends: SAP, Odoo & Oracle
history of c programming in notes for students .pptx
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
medical staffing services at VALiNTRY
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Nekopoi APK 2025 free lastest update
Design an Analysis of Algorithms II-SECS-1021-03
How to Migrate SBCGlobal Email to Yahoo Easily
Wondershare Filmora 15 Crack With Activation Key [2025

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

  • #2: 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.
  • #3: 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.
  • #4: 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.
  • #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: 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.
  • #19: Summarize presentation content by restating the important points from the lessons. What do you want the audience to remember when they leave your presentation?
  • #20: Microsoft Confidential