SlideShare a Scribd company logo
How to use Web Service Consumer
26-05-2015
Abstract
• The main motto of this PPT is How to use
Message Enricher in our applications.
Introduction
• When developing applications with Mule, users
often need to be able to consume a SOAP Web
service to acquire data from an external source.
In the best case scenario, you can use an
existing Anypoint Connector in your Mule
application to connect to a specific service
provider, such as Zuora or Avalara. However,
where no service-specific connector exists to
facilitate the connection, the quickest, easiest
way to consume a Web service from within a
Mule application is to use the Web Service
Consumer.
Example
.mflow
• <?xml version="1.0" encoding="UTF-8"?>
• <mule xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata"
xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
• xmlns:spring="http://www.springframework.org/schema/beans"
• xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
• xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
• http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
• http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
• http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
• http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd
• http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd">
• <ws:consumer-config name="Web_Service_Consumer" wsdlLocation="http://www.webservicex.com/globalweather.asmx?WSDL" service="GlobalWeather" port="GlobalWeatherSoap"
serviceAddress="http://www.webservicex.com/globalweather.asmx" doc:name="Web Service Consumer"/>
• <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8087" doc:name="HTTP Listener Configuration"/>
• <flow name="Web_Serice_ConsumerFlow">
• <http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/>
• <set-payload value="{&quot;country&quot;:&quot;india&quot; }" doc:name="Set Payload"/>
• <logger message="#[message.payload]" level="INFO" doc:name="Logger"/>
• <json:object-to-json-transformer doc:name="Object to JSON"/>
• <dw:transform-message metadata:id="02a84952-97db-4806-a276-5a22deff9fec" doc:name="Transform Message">
• <dw:set-payload><![CDATA[%dw 1.0
• %output application/xml
• %namespace ns0 http://www.webserviceX.NET
• ---
• {
• ns0#GetCitiesByCountry: {
• ns0#CountryName: payload.country
• }
• }]]></dw:set-payload>
• </dw:transform-message>
• <ws:consumer config-ref="Web_Service_Consumer" operation="GetCitiesByCountry" doc:name="Web Service Consumer"/>
• </flow>
• </mule>
• Output:
• Flow of execution:
WebService which I have consumed:
http://www.webservicex.com/globalweather.a
smx?WSDL
1. URL to trigger the service from browser
http://localhost:8087
2. Service will get all the cities for the country
code India (set payload) and displays the same
in browser
References
• https://docs.mulesoft.com/mule-user-
guide/v/3.6/web-service-consumer

More Related Content

PPTX
How to use jms outbound endpoint
PPTX
How to use jms inbound endpoint
PPTX
How to use message properties component
PPTX
Message properties component in mule
PPTX
Mulesoft idempotent Message Filter
PDF
Mule Integration Simplified
PPTX
Mule requester
PPTX
How to use choice component
How to use jms outbound endpoint
How to use jms inbound endpoint
How to use message properties component
Message properties component in mule
Mulesoft idempotent Message Filter
Mule Integration Simplified
Mule requester
How to use choice component

What's hot (15)

PPT
Anypoint data gateway
PPTX
Database component in mule
PPT
Introduction to mule esb's
 
PPTX
Mulesoft Consuming Web Service - Web Service Consumer
PDF
Mule ESB
PPTX
Mule concepts components
PPTX
Mule soa
PDF
Global Scale ESB with Mule
PPT
Mule esb presentation 2015
PPTX
Mule high availability (ha) cluster
DOCX
Mule esb beginner’s guide
PPTX
Mule chapter2
PPT
Mule real-world-old
PPTX
Anypoint connector dev kit
PPTX
Simple webservice with vm
 
Anypoint data gateway
Database component in mule
Introduction to mule esb's
 
Mulesoft Consuming Web Service - Web Service Consumer
Mule ESB
Mule concepts components
Mule soa
Global Scale ESB with Mule
Mule esb presentation 2015
Mule high availability (ha) cluster
Mule esb beginner’s guide
Mule chapter2
Mule real-world-old
Anypoint connector dev kit
Simple webservice with vm
 
Ad

Viewers also liked (15)

DOC
M A U N A ( S I L E N C E) & S U P E R L I V I N G D R S H R I N I W A S ...
PDF
Капсульные кофемашины Keurig Lavazza от Stockist Italy
PPTX
Development pro forma
PDF
Полные кухонные комплекты Spar и Stosa от компании Stockist Italy
PDF
ECE 201 ENTIRE COURSE
PPTX
How to use attachment transformer
PPTX
How to use message enricher
DOCX
Lo3 workbook
PPTX
ApresentaçãO OperaçõEs1
PPTX
Prepositions
PDF
ApresentaçãO Fluxo Dry Wall
PPTX
PPTX
File types pro forma
PPTX
Les instruments musicals
DOCX
La brochure
M A U N A ( S I L E N C E) & S U P E R L I V I N G D R S H R I N I W A S ...
Капсульные кофемашины Keurig Lavazza от Stockist Italy
Development pro forma
Полные кухонные комплекты Spar и Stosa от компании Stockist Italy
ECE 201 ENTIRE COURSE
How to use attachment transformer
How to use message enricher
Lo3 workbook
ApresentaçãO OperaçõEs1
Prepositions
ApresentaçãO Fluxo Dry Wall
File types pro forma
Les instruments musicals
La brochure
Ad

Similar to How to use web service consumer (20)

PPTX
Mule esb whole_web_services
PPTX
Mule esb _web_services
PPTX
Mule webservices
PPT
Rest service in mule
PPT
Rest Service In Mule
PPTX
Using mule with web services
PPTX
Wt8 consuming web services
PPTX
SOAP To REST API Proxy
PPTX
How to use Cache scope
PPTX
How to – rest api proxy to soap webservice
PPTX
Rest web services
PPTX
Mule connectors-session1
PPTX
Mule connectors-part 1
PPTX
Brisbane MuleSoft Meetup 2023-03-22 - Anypoint Code Builder and Splunk Loggin...
PPTX
Consuming raml
PPTX
Muleesbcomponents1 160625154208
PDF
Mule : Building Blocks for Microservices
PDF
Microservices &amp; anypoint service mesh calgary mule soft meetup
PPTX
Mule soft ppt 2
Mule esb whole_web_services
Mule esb _web_services
Mule webservices
Rest service in mule
Rest Service In Mule
Using mule with web services
Wt8 consuming web services
SOAP To REST API Proxy
How to use Cache scope
How to – rest api proxy to soap webservice
Rest web services
Mule connectors-session1
Mule connectors-part 1
Brisbane MuleSoft Meetup 2023-03-22 - Anypoint Code Builder and Splunk Loggin...
Consuming raml
Muleesbcomponents1 160625154208
Mule : Building Blocks for Microservices
Microservices &amp; anypoint service mesh calgary mule soft meetup
Mule soft ppt 2

More from sivachandra mandalapu (20)

PPTX
Mock component in munit
PPTX
Jms selector
PPTX
PPTX
Object store
PPTX
How to use SFTP
PPTX
How to use secure property placeholder
PPTX
Specifying a default exception strategy
PPTX
Defining global exception strategies
PPTX
Reference exception strategy
PPTX
Validate json schema
PPTX
PPTX
Property place holder
PPTX
Collection aggregator
PPTX
Cloud hub deployment
PPTX
Securing api with_o_auth2
PPTX
Deployment options for mule applications
PPTX
Setting up organization with api access
PPTX
API gateway setup
PPTX
PPTX
Mock component in munit
Jms selector
Object store
How to use SFTP
How to use secure property placeholder
Specifying a default exception strategy
Defining global exception strategies
Reference exception strategy
Validate json schema
Property place holder
Collection aggregator
Cloud hub deployment
Securing api with_o_auth2
Deployment options for mule applications
Setting up organization with api access
API gateway setup

Recently uploaded (20)

PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Computing-Curriculum for Schools in Ghana
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Pre independence Education in Inndia.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Institutional Correction lecture only . . .
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
O7-L3 Supply Chain Operations - ICLT Program
FourierSeries-QuestionsWithAnswers(Part-A).pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Computing-Curriculum for Schools in Ghana
Sports Quiz easy sports quiz sports quiz
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Microbial diseases, their pathogenesis and prophylaxis
Complications of Minimal Access Surgery at WLH
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Supply Chain Operations Speaking Notes -ICLT Program
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Module 4: Burden of Disease Tutorial Slides S2 2025
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
VCE English Exam - Section C Student Revision Booklet
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Pre independence Education in Inndia.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Institutional Correction lecture only . . .
Anesthesia in Laparoscopic Surgery in India
O7-L3 Supply Chain Operations - ICLT Program

How to use web service consumer

  • 1. How to use Web Service Consumer 26-05-2015
  • 2. Abstract • The main motto of this PPT is How to use Message Enricher in our applications.
  • 3. Introduction • When developing applications with Mule, users often need to be able to consume a SOAP Web service to acquire data from an external source. In the best case scenario, you can use an existing Anypoint Connector in your Mule application to connect to a specific service provider, such as Zuora or Avalara. However, where no service-specific connector exists to facilitate the connection, the quickest, easiest way to consume a Web service from within a Mule application is to use the Web Service Consumer.
  • 5. .mflow • <?xml version="1.0" encoding="UTF-8"?> • <mule xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" • xmlns:spring="http://www.springframework.org/schema/beans" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd • http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd • http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd • http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd • http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd • http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd"> • <ws:consumer-config name="Web_Service_Consumer" wsdlLocation="http://www.webservicex.com/globalweather.asmx?WSDL" service="GlobalWeather" port="GlobalWeatherSoap" serviceAddress="http://www.webservicex.com/globalweather.asmx" doc:name="Web Service Consumer"/> • <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8087" doc:name="HTTP Listener Configuration"/> • <flow name="Web_Serice_ConsumerFlow"> • <http:listener config-ref="HTTP_Listener_Configuration" path="/*" doc:name="HTTP"/> • <set-payload value="{&quot;country&quot;:&quot;india&quot; }" doc:name="Set Payload"/> • <logger message="#[message.payload]" level="INFO" doc:name="Logger"/> • <json:object-to-json-transformer doc:name="Object to JSON"/> • <dw:transform-message metadata:id="02a84952-97db-4806-a276-5a22deff9fec" doc:name="Transform Message"> • <dw:set-payload><![CDATA[%dw 1.0 • %output application/xml • %namespace ns0 http://www.webserviceX.NET • --- • { • ns0#GetCitiesByCountry: { • ns0#CountryName: payload.country • } • }]]></dw:set-payload> • </dw:transform-message> • <ws:consumer config-ref="Web_Service_Consumer" operation="GetCitiesByCountry" doc:name="Web Service Consumer"/> • </flow> • </mule>
  • 7. • Flow of execution: WebService which I have consumed: http://www.webservicex.com/globalweather.a smx?WSDL 1. URL to trigger the service from browser http://localhost:8087 2. Service will get all the cities for the country code India (set payload) and displays the same in browser