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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Summarize presentation content by restating the important points from the lessons.
What do you want the audience to remember when they leave your presentation?