Table of contents
1.
Introduction
2.
What is a SOAP request?
3.
Setting the SOAP endpoint
4.
Adding Body data
5.
Setting the Headers
6.
Send SOAP Request
7.
Frequently Asked Questions
7.1.
For what purpose is Postman used?
7.2.
What is a SOAP request?
7.3.
What is the difference between SOAP and REST API?
8.
Conclusion
Last Updated: Mar 27, 2024

Making SOAP Requests in Postman

Author Neha Chauhan
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Postman is an API development platform for designing, building and testing API (Application Programming Interface). It can create different HTTP requests (GET, POST, PUT), save environments for later use, and convert the API to code for various languages (like JavaScript, Python).

SOAP og img

SOAP (Soap Object Access Protocol) is a platform-independent XML-based messaging protocol for exchanging messages between computers. It is a format for sending and receiving messages. Postman allows its users to send HTTP messages using the SOAP endpoint. 

In this article, we will discuss how to make SOAP requests in Postman.

What is a SOAP request?

SOAP info

Each application communicates with another application over the internet and these web applications run on different operating systems, technologies, and programming languages.  The best way of communication between applications is over the HTTP, which is done best using SOAP (Soap Object Access Protocol).

SOAP is an XML-based application communication protocol used to exchange messages between computers. 

In simple terms, SOAP is an XML-type format for sending and receiving messages between applications that communicate via the Internet.

Setting the SOAP endpoint

To set a SOAP request head over to your Postman Desktop Application.

🚀 Click on the ➕ button to start a new request. 

🚀 Select POST from the various Request Verbs available. 

🚀 Enter the endpoint URL in the address bar. 


 For this example, we will use the following endpoint    http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso 

This endpoint will return the name of the Capital of the country. 

SOAP Point

Adding Body data

🚀Change to the Body Tab under the request text box.

🚀From the various options, select Raw. 

🚀 Change the text type to XML type. 

Enter the following XML text in the message box-

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CapitalCity xmlns="http://www.oorsprong.org/websamples.countryinfo">
      <sCountryISOCode>US</sCountryISOCode>
    </CapitalCity>
  </soap:Body>
</soap:Envelope>

Using the above XML text, we are sending a request to return the name of the Capital city of the country US. 

Output img

✅ The above image shows the output of the request we have sent. The output is an XML text returning the name of the Capital of the country.

Setting the Headers

🚀 Go to the Headers tab. 

🚀 Make the hidden headers visible. 

When we enter the XML body type, the Content-type header by default, is set to application/xml. Some services do not support this type of content, in such case manually override the Content-type to text/xml.

For this example, change the application/xml to text/xml.

🚀 Deselect the Content-type header.

🚀 Change the Content-type header to text/xml by making a new key-value pair.

Output img

Send SOAP Request

After the Body text and the headers have been set. Click on the Send button.

✅ The following response is received. 

Output img

The response is Washington, the Capital of the US. 

Yay!🤩 You have successfully created and sent a SOAP request in the Postman. 

Frequently Asked Questions

For what purpose is Postman used?

Postman is an API client that makes it easy for developers to create, share, test and document APIs. Users are allowed to create and save simple and complex HTTP/s requests, as well as read their responses.

What is a SOAP request?

SOAP is an ordinary XML-based application communication protocol that is used to exchange messages between computers.

What is the difference between SOAP and REST API?

REST APIs are based on URIs (Uniform Resource Identifier) and the HTTP protocol and use JSON for a data format. SOAP (Soap Object Access Protocol) is a platform-independent XML-based messaging protocol used for exchanging messages between computers. SOAP is a protocol, whereas REST is an architectural style. 

Conclusion

Pat yourself on the back👏 for finishing this article. In this article, we discussed what a SOAP request is and how to send a SOAP request using Postman. We have discussed setting the body and headers of the request. 

After reading this article, if you are interested in knowing more about Postman, we recommend you to read some of our articles -

🔥 Managing Environment in Postman

🔥 Postman Interceptor

🔥 Postman Scripts

You can refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingSystem Design, and many more!

Head over to our practice platform Coding Ninjas Studio to practice top problems, attempt mock tests, read interview experiences, interview bundle, follow guided paths for placement preparations, and much more!!

We wish you Good Luck!🎈 Please upvote our blog 🏆 and help other ninjas grow.

Live masterclass