MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
VinceSoliza
1,538 views
14 slides
Mar 15, 2016
Slide 1 of 14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
About This Presentation
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
Size: 1.26 MB
Language: en
Added: Mar 15, 2016
Slides: 14 pages
Slide Content
Consuming SOAP Web Service - MuleSoft CXF Proxy- Client Module Vince Jason Soliza
MuleSoft CXF Proxy Client Module When using CXF inside of Mule, there are several different ways to consume web service. One is the Proxy Client: Unlike jax - ws -client that oblige to use JAXB -Objects, this one could work directly with XML when consuming web services.
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 Flow Reference Reference to the Flow of EchoServiceFlow Transform Message Parse the response of EchoServiceFlow to XML
CXF Client Components CXF proxy- 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.
cxf:proxy- client Configuration CXF proxies support working with the SOAP body or the entire SOAP envelope. By default only the SOAP body is sent as payload, but the payload mode can be set via the "payload" attribute to envelope if needed .
Cxf:proxy- client Configuration We put cxf:proxy-client into a new private flow, to wrap it as a SOAP web service consumer. code snippet : <flow name=" EchoServiceProxyFlow "> < cxf:proxy-client doc:name ="CXF" soapVersion ="1.2" payload="body" /> < http:request config -ref=" HTTP_Request_Configuration " path="/echo- ws / ws / EchoService " method="POST" doc:name ="HTTP" /> </flow>
Response Configuration The cxf:proxy-client response can be parsed directly with Transform Message.
Test the application Run the application in A nypoint 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 cxf:proxy-client as web service consumer .
Summary This slide describes how to consume web services using the CXF proxy-client message processor. While it is recommended to use web service consumer in consuming SOAP web service there are several reasons you may want to use proxy-client, such as: Y ou don’t want to use the WSDL You want to work with the SOAP envelope To take advantage of the CXF web service standards support to use WS-Security or WS-Addressing