SlideShare a Scribd company logo
1 of 14
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.
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>
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.
Response 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#EchoResponse: {
EchoResult: {
EchoInfo: {
Id:
payload.echo#EchoResponse.EchoResult.EchoInfo.Id,
Name:
payload.echo#EchoResponse.EchoResult.EchoInfo.Name,
Description:
payload.echo#EchoResponse.EchoResult.EchoInfo.Description,
OtherInfo:
payload.echo#EchoResponse.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 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:
• You 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
QUESTIONS?
Please leave a comment 

More Related Content

What's hot

Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guideSindhu VL
 
ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using MuleKhasim Cise
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patternsSindhu VL
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web servicesShanky Gupta
 
Mule requester
Mule requesterMule requester
Mule requesterSindhu VL
 
Introduction to mule esb's
Introduction to mule esb's Introduction to mule esb's
Introduction to mule esb's F K
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in muleMohammed246
 
A Workhorse Named Mule
A Workhorse Named MuleA Workhorse Named Mule
A Workhorse Named MuleDavid Dossot
 

What's hot (16)

How muleworks
How muleworksHow muleworks
How muleworks
 
Mule execution
Mule executionMule execution
Mule execution
 
4. mule real-world-old
4. mule real-world-old4. mule real-world-old
4. mule real-world-old
 
Mule - beginners guide
Mule - beginners guideMule - beginners guide
Mule - beginners guide
 
ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using Mule
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patterns
 
Using mule with web services
Using mule with web servicesUsing mule with web services
Using mule with web services
 
Mule requester
Mule requesterMule requester
Mule requester
 
Introduction to mule esb's
Introduction to mule esb's Introduction to mule esb's
Introduction to mule esb's
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
A Workhorse Named Mule
A Workhorse Named MuleA Workhorse Named Mule
A Workhorse Named Mule
 
Mule esb
Mule esbMule esb
Mule esb
 
Mule real-world-old
Mule real-world-oldMule real-world-old
Mule real-world-old
 
Mule overview
Mule overviewMule overview
Mule overview
 
Mule core concepts
Mule core conceptsMule core concepts
Mule core concepts
 

Viewers also liked

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
 
MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client ModuleMuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client ModuleVince Soliza
 
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
 
Mule soap client demo
Mule soap client demoMule soap client demo
Mule soap client demoKaj Bromose
 
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
 
ESB Online Training Part 2
ESB Online Training Part 2ESB Online Training Part 2
ESB Online Training Part 2Vince Soliza
 

Viewers also liked (11)

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
 
MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client ModuleMuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
MuleSoft Consuming Soap Web Service - CXF jax-ws-client Module
 
Studio Quality team
Studio Quality teamStudio Quality team
Studio Quality team
 
XaaS
XaaSXaaS
XaaS
 
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
 
Mule soap client demo
Mule soap client demoMule soap client demo
Mule soap client demo
 
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
 
ESB Online Training Part 2
ESB Online Training Part 2ESB Online Training Part 2
ESB Online Training Part 2
 

Similar to Consuming SOAP Web Services with MuleSoft CXF Proxy Client

Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in muleAnirban Sen Chowdhary
 
Difference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxwsDifference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxwsVenkataNaveen Kumar
 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in muleAnirban Sen Chowdhary
 
Web service through cxf
Web service through cxfWeb service through cxf
Web service through cxfRoger Xia
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Conceptspasam suresh
 
Soa 11 representational state transfer rest
Soa 11 representational state transfer restSoa 11 representational state transfer rest
Soa 11 representational state transfer restVaibhav Khanna
 
Web service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopWeb service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopNishikant Taksande
 
Jax ws
Jax wsJax ws
Jax wsF K
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)ipower softwares
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Ben Robb
 
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...BizTalk360
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixAdrian Trenaman
 

Similar to Consuming SOAP Web Services with MuleSoft CXF Proxy Client (20)

Mule soft ppt 2
Mule soft ppt  2Mule soft ppt  2
Mule soft ppt 2
 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in mule
 
Difference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxwsDifference between cxf Proxy_and cxf_jaxws
Difference between cxf Proxy_and cxf_jaxws
 
Playing with cxf interceptor in mule
Playing with cxf interceptor in mulePlaying with cxf interceptor in mule
Playing with cxf interceptor in mule
 
Web service through cxf
Web service through cxfWeb service through cxf
Web service through cxf
 
Web services Concepts
Web services ConceptsWeb services Concepts
Web services Concepts
 
Restful API's with ColdFusion
Restful API's with ColdFusionRestful API's with ColdFusion
Restful API's with ColdFusion
 
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
 
Soa 11 representational state transfer rest
Soa 11 representational state transfer restSoa 11 representational state transfer rest
Soa 11 representational state transfer rest
 
Web service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National WokshopWeb service- Guest Lecture at National Wokshop
Web service- Guest Lecture at National Wokshop
 
WCF
WCFWCF
WCF
 
Jax ws
Jax wsJax ws
Jax ws
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
 
Advaced training-wso2-esb
Advaced training-wso2-esbAdvaced training-wso2-esb
Advaced training-wso2-esb
 
Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010Introduction to the Client OM in SharePoint 2010
Introduction to the Client OM in SharePoint 2010
 
Web Programming
Web ProgrammingWeb Programming
Web Programming
 
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...
Use Windows Azure Service Bus, BizTalk Services, Mobile Services, and BizTalk...
 
Building Web Services
Building Web ServicesBuilding Web Services
Building Web Services
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMix
 

Recently uploaded

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Recently uploaded (20)

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

Consuming SOAP Web Services with MuleSoft CXF Proxy Client

  • 1. CONSUMING SOAP WEB SERVICE - MULESOFT CXF PROXY-CLIENT MODULE Vince Jason Soliza
  • 2. 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.
  • 3. Create 2 Flows: Main Flow & CXF Client Flow
  • 4. 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
  • 5. CXF Client Components • CXF – proxy-client configuration • HTTP request – http request hold the configuration for the target endpoint
  • 6. 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.
  • 7. 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>
  • 8. 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.
  • 9. 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>
  • 10. Response Configuration The cxf:proxy-client response can be parsed directly with Transform Message.
  • 11. Response 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#EchoResponse: { EchoResult: { EchoInfo: { Id: payload.echo#EchoResponse.EchoResult.EchoInfo.Id, Name: payload.echo#EchoResponse.EchoResult.EchoInfo.Name, Description: payload.echo#EchoResponse.EchoResult.EchoInfo.Description, OtherInfo: payload.echo#EchoResponse.EchoResult.EchoInfo.OtherInfo } } } }]]></dw:set-payload> </dw:transform-message>
  • 12. 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 cxf:proxy-client as web service consumer.
  • 13. 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: • You 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

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