SlideShare une entreprise Scribd logo
1  sur  13
Using Mule with Web Services
Shanky Gupta
Introduction
 Mule ESB allows different integration scenarios using Web
services:
 Consuming existing Web services
 Building Web services and exposing them to other
applications
 Creating a proxy/gateway to existing Web services (for
example, adding security to an existing Web service)
 Here we explore in a deeper way what options exist in each of
these scenarios and direct you to other documentation
sources and examples.
CXF Module Overview
 Before explaining the different Web service scenarios that you
can accomplish using Mule ESB, it is important to understand
that the main technology on which it relies on is Apache CXF.
Apache CXF is an open-source services framework that helps
you build and develop services using front-end programming
APIs, like JAX-WS and JAX-RS. Mule ESB now bundles the CXF
Module that provides Web services integration for consuming
existing Web services and building new ones.
Consuming Web Services
 If you invoke an existing Web service, you usually build a Web service client to
perform the call. If you have ever experienced this, you will understand it
requires some code generation—you can learn about different ways to
accomplish this with Apache CXF here).
 With Mule ESB you can simplify the way Web services can be consumed, but
mainly you have many features out-of-the-box when invoking the service (e.g,
security) and to handle and process the results, such as transformations and
using the results in a complex flow.
 Mule ESB provides different alternatives to consume web services:
 Generate and use a client from a WSDL
 Use a Client Based on the Interface of a JAX-WS Service
 Use a client based on the interface of a "simple" frontend web service
 Use the JAX-WS Java Client API
Generate and use a client from a WSDL
 This is a good approach when you need to consume third-
party web services or in other cases where you don’t have the
web service code.
 When consuming a web service this way, do the following:
 Generate a CXF client using the WSDL to Java tool from CXF or the
Maven plugin.
 Configure the client in the Mule configuration XML file using the
<cxf:jaxws-client> component.
 Configure an endpoint in the Mule configuration XML file that will be
the transport to request the service (usually HTTP).
Use a Client Based on the Interface of a JAX-WS
Service
 If you have access to the code used to build the Web service,
you can build a client for your JAX-WS services with no need
to generate a client from the WSDL.
 To consume a web service this way, do the following:
 Copy your service interface and all your data objects locally.
 Configure the client in the Mule configuration XML file using the
<cxf:jaxws-client> component.
 Configure an endpoint in the Mule configuration XML file that will be
the transport to request the service (usually HTTP).
Use a Client Based on the Interface of a "Simple"
Front-End Web Service
 If you are not using the JAX-WS service, you have a copy of your
service interface and all your data objects locally, and the service is
simple enough you may consider building a client for your simple
front end-based services without generating a client from the
WSDL.
 In order to consume a Web service this way, do the following:
 Copy your service interface and all your data objects locally.
 Configure the client in the Mule configuration XML file using the
<cxf:simple-client> component.
 Configure an endpoint in the Mule configuration XML file that will be the
transport to request the service (usually HTTP).
Use the JAX-WS Java Client API
 You can also use a Web service client API to communicate
with Web services outside of Mule configurations. This means
that you can invoke services from within your Java classes that
can then be used from within Mule ESB.
 As before, based on whether you will use the WSDL or
whether you’ve built your service via "code-first"
methodologies, there are two ways to use CXF clients:
 Use the JAX-WS Client API.
 Build a Client Proxy.
Exposing Web Services
 Mule ESB can be used to host your own Web services. In the
same way you can consume Web services from Mule ESB, you
can also build and expose them. Here are three different ways
to do this:
Create a JAX-WS Service.
Create a WSDL First JAX-WS Service.
Create a Simple Front-End Web Service.
Create a JAX-WS Service
 The JAX-WS specification is a series of APIs and annotations
to help you build web services. To build and expose a Web
service this way you will need to accomplish the following:
 Write a Java class that represent Web services (with the @WebService
annotation) to expose its methods so that they can be invoked
remotely.
 Configure the endpoint that will be accepting requests to the Web
service (usually a HTTP inbound endpoint).
 Configure the service in the Mule configuration XML file using the
<cxf:jaxws-service> component.
Create a WSDL First JAX-WS Service
 This is where you first define the WSDL and then code the
web services. To build a Web service this way and configure it
in Mule you should:
 Generate your Web service interface from your WSDL using WSDL to
Java tool from CXF or the Maven plugin.
 Write the service implementation class that implements your service
interface.
 Configure the endpoint that will be accepting requests to the Web
service, usually a HTTP inbound endpoint.
 Configure the service in the Mule XML configuration file using the
<cxf:jaxws-service> component.
Create a Simple Front-End Web Service
 This is the best approach if you want to create a simple Web service
out of an existing POJO. In this way, you need not use annotations,
and though writing an interface is not required, it is recommended as
it will make the Web service easy to consume. To build a Web service
this way and configure it in Mule, do the following:
 Use an existing simple Java class (POJO) or write a new one.
 Configure the endpoint that will be accepting requests to the Web service
(usually a HTTP inbound endpoint).
 Configure the service in the Mule configuration XML file using
the <cxf:jaxws-service> component.
Proxying Web Services
 Using Mule ESB as a Web service proxy is a feature that you may want to use
when:
 You need to add security to an existing 3rd party web service (you don’t have the
code or own the infrastructure).
 You need to add or remove HTTP headers.
 You need to validate or transform input or output of the Web service.
 You may need to transform the SOAP envelope.
 You may want to take advantage of the CXF Web service standards support to use
WS-Security, WS-Addressing or to enforce WS-Policy assertions.
 Introduce custom error handling.
 There are many other scenarios where you may also need to consider proxying
Web services.
 You have two types of proxying:
 Server-side Proxying
 Client-side Proxying

Contenu connexe

Tendances

Create Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBCreate Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBSanjeet Pandey
 
Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esbRaviShankar Mishra
 
Integration with Sercice-Now using Mule ESB
Integration with Sercice-Now using Mule ESBIntegration with Sercice-Now using Mule ESB
Integration with Sercice-Now using Mule ESBSanjeet Pandey
 
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 esbAnand kalla
 
ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using MuleKhasim Cise
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in muleMohammed246
 
Mule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 ConnectorMule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 ConnectorAnkush Sharma
 
Until successful component in mule demo
Until successful component in mule demoUntil successful component in mule demo
Until successful component in mule demoSudha Ch
 
Database component in mule
Database component in muleDatabase component in mule
Database component in muleRajkattamuri
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mulesathishmca143
 
A Workhorse Named Mule
A Workhorse Named MuleA Workhorse Named Mule
A Workhorse Named MuleDavid Dossot
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patternsSindhu VL
 
Mule Integration Simplified
Mule Integration SimplifiedMule Integration Simplified
Mule Integration SimplifiedBui Kiet
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in MuleKhasim Saheb
 

Tendances (18)

Create Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESBCreate Account in Salesforce using Mule ESB
Create Account in Salesforce using Mule ESB
 
Creating restful api using mule esb
Creating restful api using mule esbCreating restful api using mule esb
Creating restful api using mule esb
 
Integration with Sercice-Now using Mule ESB
Integration with Sercice-Now using Mule ESBIntegration with Sercice-Now using Mule ESB
Integration with Sercice-Now using Mule ESB
 
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
 
ESB introduction using Mule
ESB introduction using MuleESB introduction using Mule
ESB introduction using Mule
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
Mule velocity
Mule velocityMule velocity
Mule velocity
 
Mule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 ConnectorMule Microsoft Dynamics AX 2012 Connector
Mule Microsoft Dynamics AX 2012 Connector
 
Until successful component in mule demo
Until successful component in mule demoUntil successful component in mule demo
Until successful component in mule demo
 
Database component in mule
Database component in muleDatabase component in mule
Database component in mule
 
Bindings of components in mule
Bindings of components in muleBindings of components in mule
Bindings of components in mule
 
A Workhorse Named Mule
A Workhorse Named MuleA Workhorse Named Mule
A Workhorse Named Mule
 
Using mule configuration patterns
Using mule configuration patternsUsing mule configuration patterns
Using mule configuration patterns
 
Mule and web services
Mule and web servicesMule and web services
Mule and web services
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in mule
 
Mule Integration Simplified
Mule Integration SimplifiedMule Integration Simplified
Mule Integration Simplified
 
Stored procedure in Mule
Stored procedure in MuleStored procedure in Mule
Stored procedure in Mule
 
VM example in mule
VM example in muleVM example in mule
VM example in mule
 

En vedette

CloudHub networking guide
CloudHub networking guideCloudHub networking guide
CloudHub networking guideShanky Gupta
 
VYATTA USERS MEETING Spring 2014
VYATTA USERS MEETING Spring 2014VYATTA USERS MEETING Spring 2014
VYATTA USERS MEETING Spring 2014Hiroyasu Suzuki
 
Mule message structure
Mule message structureMule message structure
Mule message structureShanky Gupta
 
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
 
AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介
AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介
AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介Amazon Web Services Japan
 

En vedette (10)

CloudHub networking guide
CloudHub networking guideCloudHub networking guide
CloudHub networking guide
 
Cloudhub fabric
Cloudhub fabricCloudhub fabric
Cloudhub fabric
 
Studio Quality team
Studio Quality teamStudio Quality team
Studio Quality team
 
VYATTA USERS MEETING Spring 2014
VYATTA USERS MEETING Spring 2014VYATTA USERS MEETING Spring 2014
VYATTA USERS MEETING Spring 2014
 
XaaS
XaaSXaaS
XaaS
 
Mule message structure
Mule message structureMule message structure
Mule message structure
 
Load balancer in mule
Load balancer in muleLoad balancer in mule
Load balancer in mule
 
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
 
AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介
AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介
AWS初心者向けWebinar 失敗例を成功に変える AWSアンチパターンのご紹介
 

Similaire à Using mule with web services

Web service through cxf
Web service through cxfWeb service through cxf
Web service through cxfRoger Xia
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Mindfire Solutions
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a databaseSon Nguyen
 
Xml web services
Xml web servicesXml web services
Xml web servicesRaghu nath
 
WebService with VM Mule
WebService with VM MuleWebService with VM Mule
WebService with VM Muleirfan1008
 
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 vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in muleShahid Shaik
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in muleSunil Komarapu
 
Webservice vm in mule
Webservice vm in muleWebservice vm in mule
Webservice vm in muleShahid Shaik
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in muleHasan Syed
 
Exposing Web Service (CXF) With Mule ESB
Exposing Web Service (CXF) With Mule ESBExposing Web Service (CXF) With Mule ESB
Exposing Web Service (CXF) With Mule ESBJitendra Bafna
 
Mule execution units
Mule execution unitsMule execution units
Mule execution unitskiranvanga
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)ipower softwares
 
Web services in java
Web services in javaWeb services in java
Web services in javamaabujji
 
Webservice with vm in mule
Webservice with vm in muleWebservice with vm in mule
Webservice with vm in muleRajkattamuri
 
Webservice with vm in mule
Webservice with vm in mule Webservice with vm in mule
Webservice with vm in mule mdfkhan625
 
Webservice with vm in mule
Webservice with vm in muleWebservice with vm in mule
Webservice with vm in muleKhan625
 
Webservice with vm in mule
Webservice with vm in mule Webservice with vm in mule
Webservice with vm in mule javeed_mhd
 

Similaire à Using mule with web services (20)

Mule soft ppt 2
Mule soft ppt  2Mule soft ppt  2
Mule soft ppt 2
 
Web service through cxf
Web service through cxfWeb service through cxf
Web service through cxf
 
Mule esb soap_service
Mule esb soap_serviceMule esb soap_service
Mule esb soap_service
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 
How to – wrap soap web service around a database
How to – wrap soap web service around a databaseHow to – wrap soap web service around a database
How to – wrap soap web service around a database
 
Xml web services
Xml web servicesXml web services
Xml web services
 
WebService with VM Mule
WebService with VM MuleWebService with VM Mule
WebService with VM Mule
 
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 vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
Web service vm in mule
Web service vm in muleWeb service vm in mule
Web service vm in mule
 
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
 
Exposing Web Service (CXF) With Mule ESB
Exposing Web Service (CXF) With Mule ESBExposing Web Service (CXF) With Mule ESB
Exposing Web Service (CXF) With Mule ESB
 
Mule execution units
Mule execution unitsMule execution units
Mule execution units
 
WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)WCF (Windows Communication Foundation)
WCF (Windows Communication Foundation)
 
Web services in java
Web services in javaWeb services in java
Web services in java
 
Webservice with vm in mule
Webservice with vm in muleWebservice with vm in mule
Webservice with vm in mule
 
Webservice with vm in mule
Webservice with vm in mule Webservice with vm in mule
Webservice with vm in mule
 
Webservice with vm in mule
Webservice with vm in muleWebservice with vm in mule
Webservice with vm in mule
 
Webservice with vm in mule
Webservice with vm in mule Webservice with vm in mule
Webservice with vm in mule
 

Plus de Shanky Gupta

Mule tcat server - common problems and solutions
Mule tcat server - common problems and solutionsMule tcat server - common problems and solutions
Mule tcat server - common problems and solutionsShanky Gupta
 
Anypoint access management - Roles
Anypoint access management - RolesAnypoint access management - Roles
Anypoint access management - RolesShanky Gupta
 
Mule access management - Managing Environments and Permissions
Mule access management - Managing Environments and PermissionsMule access management - Managing Environments and Permissions
Mule access management - Managing Environments and PermissionsShanky Gupta
 
Mule: Munit domain support
Mule: Munit domain supportMule: Munit domain support
Mule: Munit domain supportShanky Gupta
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profilesShanky Gupta
 
Mule tcat server - Monitoring a server
Mule tcat server - Monitoring a serverMule tcat server - Monitoring a server
Mule tcat server - Monitoring a serverShanky Gupta
 
Mule tcat server - Monitoring applications
Mule tcat server - Monitoring applicationsMule tcat server - Monitoring applications
Mule tcat server - Monitoring applicationsShanky Gupta
 
Mule tcat server - deploying applications
Mule tcat server - deploying applicationsMule tcat server - deploying applications
Mule tcat server - deploying applicationsShanky Gupta
 
Mule tcat server - automating tasks
Mule tcat server - automating tasks Mule tcat server - automating tasks
Mule tcat server - automating tasks Shanky Gupta
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notificationsShanky Gupta
 
Mule management console Architecture
Mule management console ArchitectureMule management console Architecture
Mule management console ArchitectureShanky Gupta
 
MUnit run and wait scope
MUnit run and wait scopeMUnit run and wait scope
MUnit run and wait scopeShanky Gupta
 
MuleSoft CloudHub FAQ
MuleSoft CloudHub FAQMuleSoft CloudHub FAQ
MuleSoft CloudHub FAQShanky Gupta
 
Mule management console
Mule management consoleMule management console
Mule management consoleShanky Gupta
 
Configuring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connectorConfiguring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connectorShanky Gupta
 
Anypoint access management - Users
Anypoint access management - UsersAnypoint access management - Users
Anypoint access management - UsersShanky Gupta
 
Anypoint access management
Anypoint access management Anypoint access management
Anypoint access management Shanky Gupta
 

Plus de Shanky Gupta (20)

Mule tcat server - common problems and solutions
Mule tcat server - common problems and solutionsMule tcat server - common problems and solutions
Mule tcat server - common problems and solutions
 
Anypoint access management - Roles
Anypoint access management - RolesAnypoint access management - Roles
Anypoint access management - Roles
 
Mule access management - Managing Environments and Permissions
Mule access management - Managing Environments and PermissionsMule access management - Managing Environments and Permissions
Mule access management - Managing Environments and Permissions
 
Mule: Munit domain support
Mule: Munit domain supportMule: Munit domain support
Mule: Munit domain support
 
Mule tcat server - Server profiles
Mule tcat server - Server profilesMule tcat server - Server profiles
Mule tcat server - Server profiles
 
Mule tcat server - Monitoring a server
Mule tcat server - Monitoring a serverMule tcat server - Monitoring a server
Mule tcat server - Monitoring a server
 
Mule tcat server - Monitoring applications
Mule tcat server - Monitoring applicationsMule tcat server - Monitoring applications
Mule tcat server - Monitoring applications
 
Mule tcat server - deploying applications
Mule tcat server - deploying applicationsMule tcat server - deploying applications
Mule tcat server - deploying applications
 
Mule tcat server - automating tasks
Mule tcat server - automating tasks Mule tcat server - automating tasks
Mule tcat server - automating tasks
 
Mule agent notifications
Mule agent notificationsMule agent notifications
Mule agent notifications
 
Mule management console Architecture
Mule management console ArchitectureMule management console Architecture
Mule management console Architecture
 
MUnit run and wait scope
MUnit run and wait scopeMUnit run and wait scope
MUnit run and wait scope
 
MUnit matchers
MUnit matchersMUnit matchers
MUnit matchers
 
MuleSoft CloudHub FAQ
MuleSoft CloudHub FAQMuleSoft CloudHub FAQ
MuleSoft CloudHub FAQ
 
Mule management console
Mule management consoleMule management console
Mule management console
 
Cloudhub and Mule
Cloudhub and MuleCloudhub and Mule
Cloudhub and Mule
 
Configuring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connectorConfiguring Anypoint Studio MQ connector
Configuring Anypoint Studio MQ connector
 
Mule Security
Mule SecurityMule Security
Mule Security
 
Anypoint access management - Users
Anypoint access management - UsersAnypoint access management - Users
Anypoint access management - Users
 
Anypoint access management
Anypoint access management Anypoint access management
Anypoint access management
 

Dernier

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Dernier (20)

How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

Using mule with web services

  • 1. Using Mule with Web Services Shanky Gupta
  • 2. Introduction  Mule ESB allows different integration scenarios using Web services:  Consuming existing Web services  Building Web services and exposing them to other applications  Creating a proxy/gateway to existing Web services (for example, adding security to an existing Web service)  Here we explore in a deeper way what options exist in each of these scenarios and direct you to other documentation sources and examples.
  • 3. CXF Module Overview  Before explaining the different Web service scenarios that you can accomplish using Mule ESB, it is important to understand that the main technology on which it relies on is Apache CXF. Apache CXF is an open-source services framework that helps you build and develop services using front-end programming APIs, like JAX-WS and JAX-RS. Mule ESB now bundles the CXF Module that provides Web services integration for consuming existing Web services and building new ones.
  • 4. Consuming Web Services  If you invoke an existing Web service, you usually build a Web service client to perform the call. If you have ever experienced this, you will understand it requires some code generation—you can learn about different ways to accomplish this with Apache CXF here).  With Mule ESB you can simplify the way Web services can be consumed, but mainly you have many features out-of-the-box when invoking the service (e.g, security) and to handle and process the results, such as transformations and using the results in a complex flow.  Mule ESB provides different alternatives to consume web services:  Generate and use a client from a WSDL  Use a Client Based on the Interface of a JAX-WS Service  Use a client based on the interface of a "simple" frontend web service  Use the JAX-WS Java Client API
  • 5. Generate and use a client from a WSDL  This is a good approach when you need to consume third- party web services or in other cases where you don’t have the web service code.  When consuming a web service this way, do the following:  Generate a CXF client using the WSDL to Java tool from CXF or the Maven plugin.  Configure the client in the Mule configuration XML file using the <cxf:jaxws-client> component.  Configure an endpoint in the Mule configuration XML file that will be the transport to request the service (usually HTTP).
  • 6. Use a Client Based on the Interface of a JAX-WS Service  If you have access to the code used to build the Web service, you can build a client for your JAX-WS services with no need to generate a client from the WSDL.  To consume a web service this way, do the following:  Copy your service interface and all your data objects locally.  Configure the client in the Mule configuration XML file using the <cxf:jaxws-client> component.  Configure an endpoint in the Mule configuration XML file that will be the transport to request the service (usually HTTP).
  • 7. Use a Client Based on the Interface of a "Simple" Front-End Web Service  If you are not using the JAX-WS service, you have a copy of your service interface and all your data objects locally, and the service is simple enough you may consider building a client for your simple front end-based services without generating a client from the WSDL.  In order to consume a Web service this way, do the following:  Copy your service interface and all your data objects locally.  Configure the client in the Mule configuration XML file using the <cxf:simple-client> component.  Configure an endpoint in the Mule configuration XML file that will be the transport to request the service (usually HTTP).
  • 8. Use the JAX-WS Java Client API  You can also use a Web service client API to communicate with Web services outside of Mule configurations. This means that you can invoke services from within your Java classes that can then be used from within Mule ESB.  As before, based on whether you will use the WSDL or whether you’ve built your service via "code-first" methodologies, there are two ways to use CXF clients:  Use the JAX-WS Client API.  Build a Client Proxy.
  • 9. Exposing Web Services  Mule ESB can be used to host your own Web services. In the same way you can consume Web services from Mule ESB, you can also build and expose them. Here are three different ways to do this: Create a JAX-WS Service. Create a WSDL First JAX-WS Service. Create a Simple Front-End Web Service.
  • 10. Create a JAX-WS Service  The JAX-WS specification is a series of APIs and annotations to help you build web services. To build and expose a Web service this way you will need to accomplish the following:  Write a Java class that represent Web services (with the @WebService annotation) to expose its methods so that they can be invoked remotely.  Configure the endpoint that will be accepting requests to the Web service (usually a HTTP inbound endpoint).  Configure the service in the Mule configuration XML file using the <cxf:jaxws-service> component.
  • 11. Create a WSDL First JAX-WS Service  This is where you first define the WSDL and then code the web services. To build a Web service this way and configure it in Mule you should:  Generate your Web service interface from your WSDL using WSDL to Java tool from CXF or the Maven plugin.  Write the service implementation class that implements your service interface.  Configure the endpoint that will be accepting requests to the Web service, usually a HTTP inbound endpoint.  Configure the service in the Mule XML configuration file using the <cxf:jaxws-service> component.
  • 12. Create a Simple Front-End Web Service  This is the best approach if you want to create a simple Web service out of an existing POJO. In this way, you need not use annotations, and though writing an interface is not required, it is recommended as it will make the Web service easy to consume. To build a Web service this way and configure it in Mule, do the following:  Use an existing simple Java class (POJO) or write a new one.  Configure the endpoint that will be accepting requests to the Web service (usually a HTTP inbound endpoint).  Configure the service in the Mule configuration XML file using the <cxf:jaxws-service> component.
  • 13. Proxying Web Services  Using Mule ESB as a Web service proxy is a feature that you may want to use when:  You need to add security to an existing 3rd party web service (you don’t have the code or own the infrastructure).  You need to add or remove HTTP headers.  You need to validate or transform input or output of the Web service.  You may need to transform the SOAP envelope.  You may want to take advantage of the CXF Web service standards support to use WS-Security, WS-Addressing or to enforce WS-Policy assertions.  Introduce custom error handling.  There are many other scenarios where you may also need to consider proxying Web services.  You have two types of proxying:  Server-side Proxying  Client-side Proxying