Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Web service invocation in mule
1. Web Service Invocation in Mule
This Tutorial explains how to consume a
webservice using mule Web Service Consumer.
Pre-requisites:
● Anypoint Studio
● Weather Web Service
2. In the below flow I am setting the city zip code as payload in
“Set Payload” Component.
DataMapper component maps this value to the Weather
Webservice Operation “GetCityForecastByZip” Request xml
Field as “ZIP”.
Webservice Consumer component calls the Weather Web
Service to fetch the “GetCityForecastByZipResponse”.
The Next DataMapper Transforms the XML to POJO Object
i.e. GetCityForecastByZipResponse (Used for testing purpose
only, Can be removed).
Finally GetCityForecastByZipResponse Java Object will be
transformed to JSON String and given as response to Http
Component.
Which gives the City Weather Information