Calling SOAP APIs using cURLs (With Picture)

cURL commands allow developers to easily create, send, test, and debug SOAP requests and communications. In this article, I will show you how to test a SOAP web service using cURL easily.

Steven Ang Cheong Seng

Steven Ang Cheong Seng

15 May 2025

Calling SOAP APIs using cURLs (With Picture)

The phrase "SOAP cURLs" comprises two popular technologies you may have heard before. Before anything else, this article discusses the technologies and their capabilities.

💡
Apidog, an API design-first development platform, provides its users with numerous modifications and specifications for an entire API lifecycle.

If you need an API platform to build, mock, debug, or document APIs, Apidog is an optimal choice. All you have to do is click the button below. 👇 👇 👇 

Basic Terminologies on SOAP and cURLs

The terms "SOAP" and "cURL" each refer to a unique technology.

When the terms are combined, "SOAP cURLs" refers to using a cURL's functionalities to specifically interact with SOAP-based web services.

Breakdown of How SOAP cURLs Work

1. Define the SOAP message:

2. Construct the cURL command:

3. Sending the request and receiving a response:

4. Further processing of the response:

How to Call SOAP API Using cURL

Step 1: First, you will need to prepare your SOAP message. In case this is your first time creating a SOAP message, you can refer to the code sample below - however, you will need to modify it to ensure it satisfies your needs.

Sample SOAP message:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://www.example.com/webservice">
   <soapenv:Header/>
   <soapenv:Body>
      <ws:getGreeting>
         <ws:name>John Doe</ws:name>
      </ws:getGreeting>
   </soapenv:Body>
</soapenv:Envelope>
Can you guess what the message is requesting from the web service?

Step 2: Prepare your cURL command on your terminal. Similar to the step above, you can take a look at the code sample.

Sample cURL command:

curl -X POST \
-H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: http://www.example.com/webservice/getGreeting" \
-d @soap_request.xml "https://dummy.webservice.com/path/to/service"

cURL command explanation:

Real-Life Applications of SOAP cURLs

1. Legacy system integration: SOAP was often used in older enterprise applications. If you need to interact with such legacy systems that haven't been migrated to newer protocols, cURL can provide a way to manually craft and send SOAP requests for data exchange.

2. Testing and debugging SOAP web services: Developers can use cURL to directly send specific SOAP requests and analyze the responses to troubleshoot issues with SOAP web services. This allows for granular control over the request and helps isolate potential problems.

3. Custom scripts and automation: cURL can be integrated into scripts and programs to automate tasks involving SOAP communication. This could be useful for scenarios like periodically fetching data from a SOAP service or triggering specific actions based on received SOAP messages.

Apidog - Makes SOAP Testing Easier

Apidog is an API development platform that provides numerous functionalities to personalize APIs to your liking. Whether you are planning to create a new API from scratch or import a personal API you have been working on for some time, Apidog supports either choice.

api design apidog test build
Apidog functions that users can enjoy
button

Apidog supports the imports of WSDL files so that you can view SOAP-based web services. On another note, you can also generate cURL commands using Apidog's client language code generation, so you do not have to second guess whether you are right or wrong!

Importing WSDL Files to View SOAP-based Web Services on Apidog

import wsdl file apidog
Importing WSDL File onto Apidog

Firstly, press the Settings button found on the left side of the vertical toolbar. Then, locate Import Data under the Data Management section. Lastly, choose WSDL to import WSDL files onto Apidog.

Editing WSDL Files on Apidog

edit wsdl file apidog
Editing a WSDL File with Apidog

If the WSDL file has been successfully imported, you will find your WSDL file on the left, as shown in the image pointed out by Arrow 1. You can then click the numbered arrows to start editing.

Once you have your WSDL file imported and debugged, you can start testing it on Apidog for any more errors. If you are still unsure whether your WSDL file is right or wrong, check out WSDL file examples for more details.

Importing cURL to Apidog

Apidog supports importing cURL command line codes for those who have it ready.

start curl import apidog
Initializing cURL import on Apidog

On the APIs section, find a purple + button found around the top left corner of the Apidog window. Then select Import cURL. If you cannot find the mentioned button, you can use the shortcut, Ctrl + I.

paste curl command apidog
Paste your cURL command in the empty field

Here, you can paste your cURL command. Once you have, press Enter on your keyboard or the OK button to view your cURL command.

curl code body edit apidog
Decide if you need to modify anything else

if successful, you can view the cURL command as part of the JSON body, as shown in the picture above. Here, you can do tweaks or changes, wherever and whenever required.

cURL Command Code Generation Using Apidog

curl comannd code generation apidog
Generating cURL command line code

To begin cURL code generation, locate and press the </> button found in the top right corner of the Apidog window. Then, select Generate Client Code.

curl code generate apidog
Select the cURL command line code using Apidog

A pop-up window will prompt you to select which client code to generate. Here, select Shell and cURL. once you have, you can copy the code and paste it into your terminal. However, ensure that you modify it to fit your needs.

Conclusion

SOAP cURLs are two technologies that can work hand in hand, where cURL commands can be used for SOAP-based web service communication. However, do note that their use is declining due to more popular architectural styles like REST.

Apidog is an all-in-one API development platform that promotes a design-first development for APIs. With Apidog, you can easily modify and design APIs visually thanks to its simple and intuitive UI. Moreover, it is a solid choice for any developers who are interested in trying a new platform as Apidog supports various file type imports, with Postman, WSDL, and many more.

Explore more

Cypher Alpha: What's the Free Mysterious OpenRouter API?

Cypher Alpha: What's the Free Mysterious OpenRouter API?

Learn to harness OpenRouter’s free Cypher Alpha AI model with Apidog for efficient API testing. This guide covers setup, examples, and benefits for developers.

2 July 2025

How to Find the API of a Website with AI

How to Find the API of a Website with AI

Discover how to find website APIs using Hyperbrowser’s AI or Developer Tools. This guide covers setup, scanning with AI, and manual methods for sites like retouched.ai!

2 July 2025

What is Claude Code Hooks and How to Use It

What is Claude Code Hooks and How to Use It

For Vibe Coders, tools like Anthropic's Claude Code are transforming how developers write, debug, and manage their projects. Claude Code acts as an "agentic coding tool" that lives in your terminal, capable of understanding your entire codebase, interacting with your file system, running commands, and even browsing the web for documentation. It excels at tasks like writing new features, fixing bugs, and refactoring code through natural language prompts. However, a core characteristic of Large L

2 July 2025

Practice API Design-first in Apidog

Discover an easier way to build and use APIs