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
Over 2 million developers have joined DZone.
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
  • MuleSoft MCP and A2A in Production: What 17 Recipes Reveal
  • MuleSoft IDP: Enhancing Efficiency and Accuracy in Data Extraction

Trending

  • How AI Is Rewriting Full-Stack Java Systems: Practical Patterns with Spring Boot, Kafka and WebSockets
  • Why AI-Generated Code Breaks Your Testing Assumptions
  • Build Self-Managing Data Pipelines With an LLM Agent
  • AWS Managed Database Observability: Monitoring DynamoDB, ElastiCache, and Redshift Beyond CloudWatch
  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 user avatar
Jitendra Bafna
·
Updated May. 10, 17 · Tutorial
Likes (5)
Comment
Save
Tweet
Share
27.4K Views

Join the DZone community and get the full member experience.

Join For Free

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
  • MuleSoft MCP and A2A in Production: What 17 Recipes Reveal
  • MuleSoft IDP: Enhancing Efficiency and Accuracy in Data Extraction

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • 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