Lots of people call Postman, “a REST client.” They’re not wrong. However, Postman is actually used for any calls sent over HTTP. Keep reading to learn how to use Postman to make SOAP requests. Since SOAP and GraphQL are agnostic with regards to the underlying transport protocol, Postman can handle these types of calls too.
It’s fashionable these days to talk about the REST (REpresentational State Transfer) architectural pattern, but a ton of developers still run on the older SOAP (Simple Object Access Protocol). Unless your organization is brand-new, chances are you’re developing and maintaining legacy codebases that rely on SOAP.
Making SOAP Requests with Postman
If so, here’s how you can use Postman for making SOAP requests:
- Enter the SOAP endpoint as the request URL in Postman:
- Set the request method to
- Under the Body tab, set the body type to
XMLfrom the dropdown. Once you add XML data as the body, Postman will automatically add a
Content-Typeheader that can be seen under the Headers tab. While REST typically uses JSON and other data formats, SOAP relies on XML.
- Under the Headers tab, add a new header where
Content-Typeis the key and
text/xmlis the value in order to override the one added for you in the previous step, since the endpoint we’re working with requires a different
Content-Typeheader. You can deselect the originally added header.
- Back in the request body under the Body tab, define the SOAP envelope, body, and header tags. Start with the required SOAP envelope tag and define all the namespaces. Enter the SOAP body and headers. The name of the SOAP method (operation) should be specified in the SOAP body, as seen in the code block below. Then hit Send, and inspect the response.
<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"> <soap12:Body> <FahrenheitToCelsius xmlns="https://www.w3schools.com/xml/"> <Fahrenheit>75</Fahrenheit> </FahrenheitToCelsius> </soap12:Body> </soap12:Envelope>
If you’re a genius who can already do this conversion in your head, then check out this collection of other public SOAP APIs to mess around with.
And there you have it! Postman is a trusty tool to handle any API that can utilize HTTP—like REST, SOAP, and GraphQL.
This is an update of a previously published article.