NOTE: As of April 2020, there’s a new, spectacularly updated tutorial blog post on this topic with all of the latest and greatest, so we encourage you to head on over to the new post. -Ed.
Frequently called a REST client, Postman is actually a tool that handles any calls sent over HTTP. Since SOAP is agnostic with regards to the underlying transport protocol, Postman easily handles SOAP calls too.
A lot of web and mobile developers have chosen to transition new code to the REST (REpresentational State Transfer) architectural style, but a significant part of the development community still runs on SOAP (Simple Object Access Protocol). A number of these teams are maintaining legacy codebases, work with large enterprise customers who rely on SOAP, or have strict security requirements that are not satisfied by newer technologies.
Lots of developers use Postman for making HTTP SOAP requests. Here’s how:
- Enter the SOAP endpoint as the request URL in Postman.
- Set the request method to `POST`.
- Under the Body tab, set the body type to `raw` and select `XML (text/xml)` from the dropdown. This will automatically add the correct `Content-Type` header as can be seen under the Headers tab. While REST typically uses JSON and other data formats, SOAP relies on XML.
- In the request body, define the SOAP envelope, body, and header tags. Start with the 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, for example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hs="http://www.holidaywebservice.com/HolidayService_v2/"> <soapenv:Body> <hs:GetHolidaysForMonth> <hs:year>2018</hs:year> <hs:countryCode>UnitedStates</hs:countryCode> <hs:month>11</hs:month> </hs:GetHolidaysForMonth> </soapenv:Body> </soapenv:Envelope>
This example uses a holiday web service to query which holidays occur in the month of November.
And there you have it! Postman is a versatile tool to handle both your REST and SOAP testing and development.
This is an update of the originally published article.