DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • What is MuleSoft and Anypoint Platform Capabilities and Strengths
  • MuleSoft CloudHub is Multitenant Integration Platform as a Service
  • Code and Connect: MCP + MuleSoft
  • MuleSoft MCP and A2A in Production: What 17 Recipes Reveal

Trending

  • OpenCode: Setting Up an Open-Source AI Coding Assistant
  • Spring AI on Local LLMs
  • When RabbitMQ Accepts a Message but Does Not Route It to a Queue
  • Fix the Target, Precompute Once: A Backend-Free Word-Ladder Solver With a BFS Distance Field

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. How to Consume SOAP-Based Web Service With Mulesoft Anypoint Studio

How to Consume SOAP-Based Web Service With Mulesoft Anypoint Studio

Consuming SOAP-based web services with Anypoint Studio is easy. Doing so assists serialization and deserialization as well as SOAP envelope and namespace processing.

By 
Jitendra Bafna
·
Updated May. 10, 17 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
27.6K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

CXF is a Java web services framework used for SOAP (Simple Object Access Protocol) messaging. It handles all serialization and deserialization as well as SOAP envelope and namespace processing.

Now, we will walk through how to consume SOAP-based web services with Anypoint Studio.

Consume SOAP-Based Web Service

Place an HTTP listener in the source section of the flow and configure it as shown below.

Image title

Now place the Web Service Consumer components to the message processor in flow and configure the components. Click Add Connector Configuration and it will open another window. You can provide your WSDL Location (it can web service URL or any physical WSDL location) and click Reload WSDL. It will automatically fill the Service, Port, and Address for you. Press OK.

Image title

Now, you need to select one Operation that you need to perform on the Web Service. In my case, I will use findFlights. This operation is expecting one argument: destination.

Image title

Passing Arguments to Web Service

We are expecting the destination as a query parameter in input request via the HTTP listener and will store query parameter in flow variable.

Image title

Place TransformMessage between FlowVariable and Web Service Consumer and you can see that the output metadata in DataWeave is generated automatically. You can also see the input data with the flow variable that we defined previously. We will map the destination from FlowVariable to the destination argument required by Web Service.

Image title

Transform Response From Web Service 

Now we will place the one more TransformMessage after Web Service Consumer to map XML result from Web Service to JSON format. You can see input metadata in DataWeave is generated automatically. You can define output metadata as per your requirements and perform mapping.

Image title

Testing the Application

You can use Postman to test the application. First, deploy the application with Anypoint Studio.

Now, we will use the HTTP GET method in Postman to send a request to the HTTP listening to this URL.

Image title

Now, you know how to consume SOAP-based web services with Anypoint Studio!

Here is the video tutorial.


Web Service MuleSoft

Opinions expressed by DZone contributors are their own.

Related

  • What is MuleSoft and Anypoint Platform Capabilities and Strengths
  • MuleSoft CloudHub is Multitenant Integration Platform as a Service
  • Code and Connect: MCP + MuleSoft
  • MuleSoft MCP and A2A in Production: What 17 Recipes Reveal

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook