This is a guide on how to use Postman to test your SOAP APIs.
I will be using the W3school's online Web Services endpoint for this example demonstration of how to access the SOAP APIs.
W3Schools has provided "TempConvert" (Temperature Conversion) endpoint that we will use here: https://www.w3schools.com/Xml/tempconvert.asmx.
Key items you need:
- W3School's Web Services TempConvert Endpoint link: https://www.w3schools.com/Xml/tempconvert.asmx
- Postman installed on your computer so you can run the SOAP API testing. You can download it for free here: https://www.getpostman.com/downloads/
- Body request text with the formatting and fields you need from W3School here - https://www.w3schools.com/Xml/tempconvert.asmx?op=FahrenheitToCelsius
So let's run the start using Postman to test the example SOAP APIs.
How to use Postman to test your SOAP APIs
Step 1 - Open Postman and create new request
Step 2 - Add endpoint to Postman
- Set W3School's Web Services Endpoint as the link in the text box: https://www.w3schools.com/Xml/tempconvert.asmx
- Make sure it is set to "POST" request
- Make sure it is set to "raw" and "XML"
- In the "Headers" tab, "Context-Type" should equal "text/xml".
Step 3 - Add request body to your request
This is the request details you need to add to the body of your request.
This is because going to the endpoint and just asking for a response will not be clear to the endpoint what you need. So you need to tell it that you have "50" degrees Fahrenheit and you need to convert it for you using the "FahrenheitToCelsius" function.
So make sure you have this added as "XML" text in Postman. Examples below:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
Step 4 - Run the request by clicking "Send"
When you're ready. Run the request by clicking "Send" request (blue button).
You should get a response of "10" degrees celsius for this example
Video of using Postman to test your SOAP APIs:
Here's a video of using Postman to test your SOAP APIs available below:
In this video I will be showing you how to use Postman software to test your SOAP APIs and WSDL endpoints.
You can also consider using the Calculator Web Services endpoint: http://dneonline.com/calculator.asmx if you would like to test your Postman and gain a better understanding of Web Services and SOAP APIs.