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.
Join the DZone community and get the full member experience.
Join For FreeYou 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.
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.
Then, select the WSDL file in the web service consumer configuration definition.
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.
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.
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.
Video
I have created a video tutorial for the above. You can watch it here:
Opinions expressed by DZone contributors are their own.
Comments