Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Consuming SOAP Services in Mule ESB Runtime

DZone's Guide to

Consuming SOAP Services in Mule ESB Runtime

SOAP web services can be consumed using a Mule SOAP message processor called Web Service Consumer, which uses WSDL to create and discover SOAP services.

· Integration Zone
Free Resource

Share, secure, distribute, control, and monetize your APIs with the platform built with performance, time-to-value, and growth in mind. Free 90 day trial 3Scale by Red Hat

You can watch a video tutorial for the previous blog here.

In my previous blog, I covered how to create a SOAP web service. I showed how Mule runtime uses a CXF component to expose SOAP web services.

In this blog, I will show you how to consume SOAP services using a Mule SOAP web service consumer.

Image title

Web Service Consumer

This message processor in Mule uses WSDL to create and discover SOAP services. You have two ways to define the WSDL of your web service: Give the URI of WSDL or add the WSDL file to your project classpath to the src/main/wsdl folder.

Screen Shot 2017-03-09 at 18.06.45

Then, select the WSDL file in the web service consumer configuration definition.

Screen Shot 2017-03-09 at 17.44.00

With the WSDL file location or URI, the component will auto discover the service, port, and address of your web service. In the next step, we need to select the web service operation in the consumer setting.

Screen Shot 2017-03-09 at 17.44.20

After setting the web service consumer, let's place it in the flow so that we can call it using postman. We will also drag and drop DataWeave message processors to set the input arguments for the web service consumer.

Screen Shot 2017-03-09 at 17.44.38

Once we are done with setting the flow and consumer, the only thing that remains is to test it. I will be using Postman to test the flow and see if the web service is being properly called.

Screen Shot 2017-03-09 at 21.31.51

Video

I have created a video tutorial for the above. You can watch it here:

Discover how you can achielve enterpriese agility with microservices and API management

Topics:
soap ,integration ,tutorial ,mule esb ,runtime

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}