Postman Makes SOAP Requests Too


Update, April 2020: If you want to read the latest about SOAP requests, check out our new post called Making SOAP Requests with Postman.


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:

  1. Enter the SOAP endpoint as the request URL in Postman.
  2. Set the request method to POST.
  3. 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.
  4. 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

Tags:

What do you think about this topic? Tell us in a comment below.

Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

18 thoughts on “Postman Makes SOAP Requests Too

    Thanks joyce!!! Worked well for me.

    Can Postman autogenerate a default request to SOAP service using the WSDL?
    (a bit like SoapUI is doing it)

    This doesn’t work anymore.

      it seems like the xml in the raw body is selecting application/xml and not text/xml as content-type. A workaround is to setup content-type header manually

    Hi Leo,
    I’m not able to overwrite this manually.
    In the request header I double click content-type and seems to switch to edit mode but it’s still blocked . Is this the way you’re doing ?

      Yes, uncheck the Content-Type generated by default and create another Content-Type with value text/xml .
      https://prnt.sc/s09yfo

        Thanks for chiming in. Since this example was originally published, the app has changed a bit. We’ll get an updated example out.

        In the meantime, when you add a raw XML body, Postman adds a default header of `Content-Type: application/xml`. If you need to override that header, you can deselect it and manually add another header like `Content-Type: text/xml` as Ioan said.

      Make sure the checkbox to the left of the Content-Type is selected.
      Also the Content-Type is automatically added with application/xml after entering the XML in the request body.

    Would be great to have an example that sends in data to create a record rather then just have a lookup example

    Hello! I’m trying to request a SOAP API on form submission ( For a landing page) , Should I do it with zapier? can anyone help me ?

    I don’t see an answer to Flemming Madsens question, so I will just repeat.

    Can Postman autogenerate a set of default request to SOAP service using the WSDL? (a bit like SoapUI is doing it)

    Possibly through templates a bit like the autocompletion is done for GraphQL?

      No, Postman cannot autogenerate requests from a WSDL file.

    Hello,
    sometimes the soap calls are secured, we need a credentials to make it run. How and where to store the credentials for doing a specific soap call through postman?

    I am trying to use basic auth for SOAP call with passwordType set as passwordDigest – I am not sure if adding the passwordtype property is supported by Postman? I have tried adding it as header as well as in parameter. Neither seemed to work Any input will be highly helpful, thank you.

    Hi,

    might be important to mention, that many SOAP API need the SOAPAction to be set in the Headers.
    So if you get something like a “SOAPAction HTTP header missing” error as response, just add
    SOAPAction=””
    to the Headers

    soap to REST