11
CONSUMING SOAP WEB SERVICE - MULESOFT WEB SERVICE CONSUMER Vince Jason Soliza

Mulesoft Consuming Web Service - Web Service Consumer

Embed Size (px)

Citation preview

Page 1: Mulesoft Consuming Web Service - Web Service Consumer

CONSUMING SOAP WEB SERVICE

- MULESOFT WEB SERVICE CONSUMER

Vince Jason Soliza

Page 2: Mulesoft Consuming Web Service - Web Service Consumer

Mulesoft Web Service ConsumerWhen developing applications with Mule, users often need to be able to consume a SOAP Web service to acquire data from an external source. The recommended way is to use the Web Service Consumer. It’s the quickest, easiest way to consume a Web service.

Page 3: Mulesoft Consuming Web Service - Web Service Consumer

Create a Simple Flow• HTTP (inbound)• Transform Message (create a request)• Web Service Consumer (consume SOAP web service)

Page 4: Mulesoft Consuming Web Service - Web Service Consumer

Configure Web Service Consumer• Get the WSDL file of the SOAP Web service you intend to consume, or

identifying the URL of the WSDL.• Using a WSDL file, copy the file into the` src/main/resources` folder of

your Studio project• Define the Global Configuration of the connector: click the plus sign next

to the Global Configuration field. • In the window that opens, begin by entering a value in the WSDL Location

field. Populate this field first, with either the WSDL’s URL, or the filepath and filename of the WSDL file you copied into the src/main/resources folder of your project. Upon filling this field, you five Studio the opportunity to read the contents of the WSDL and automatically populate the remaining empty fields — Service, Port and Address — using information contained in the WSDL file. Alternatively, you can manually populate these fields with the appropriate information about the Web service.

Page 5: Mulesoft Consuming Web Service - Web Service Consumer

Configure Web Service ConsumerWhen the WSDL is located in the resource file.

Page 6: Mulesoft Consuming Web Service - Web Service Consumer

Configure Web Service ConsumerWhen the WSDL is located in url.

Page 7: Mulesoft Consuming Web Service - Web Service Consumer

Configure Web Service Consumer• Confirm that the Enable DataSense box is checked, then click OK to save.• Adjust the Operation of the Web Service Consumer, if you wish (and if the

SOAP Web service indeed offers more than one operation), then click inside the canvas to auto-save your configuration.

Page 8: Mulesoft Consuming Web Service - Web Service Consumer

Transform Message• Create a request in Transform Message that will be used as payload to

invoke the web service consumer.

Page 9: Mulesoft Consuming Web Service - Web Service Consumer

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 web service consumer.

Page 10: Mulesoft Consuming Web Service - Web Service Consumer

Summary

When sending requests to an external web service, the recommended approach is to use the Web Service Consumer because it’s faster and easier to use.

Page 11: Mulesoft Consuming Web Service - Web Service Consumer

QUESTIONS?Please leave a comment