SOAP Requests with Postman

Kris Sparks
4 min readSep 13, 2017
getpostman.com header

Postman is a clean, easy-to-use REST client, but it also works well for sending SOAP message via HTTP. Configuring Postman for a SOAP request is similar to a REST configuration.

It might help if you already understand:

- Sending REST API requests with Postman

- SOAP APIs

For the purpose of this walkthrough we’ll use a mock company called Robot Lenders. We will send a SOAP request, or message, containing applicant information for a loan pre-qualification.

VERB and URL

We’ll submit a POST request to the Robot Lenders API using the following URL and endpoint: of https://www.robot-lending.com/quick-loan

Sample VERB and URL in Postman interface

HTTP Headers

Next we’ll set the HTTP headers (not to be confused with headers in the SOAP envelope).

Let’s set the ContentType header. Below the URL:

  1. Click on Body
  2. Check raw
  3. Select XML text/xml
Example of how to select raw data type

By selecting XML(text/xml) Postman automatically adds a ContentType header with the value text/xml.

Example of a Content-Type header

Now we’ll take a look at the SOAPAction header. This seems to be point of confusion for developers working with SOAP APIs… and for good reason.

Read more about SOAPAction in this article by Mark Baker.

Read about using SOAPAction in the comments in the Postman Blog.

In our example, if we send the request without a SOAPAction header we may get an error: <faultstring>no SOAPAction header!</faultstring> Though our example does not require a specific SOAPAction it will fail if we leave the header out completely, so we have to include the header and enter a value of "" (an empty string).

Example of a SOAPAction header

If you are not familiar a SOAP Message, check out: Anatomy of a SOAP Message.

The Body

Click on Body and enter the XML/text body.

Example of a SOAP request body

We should be ready. Let’s fire off our request by hitting Send

Important: You should be aware this is a mock demonstration and not a working API. Entering the data from this tutorial into Postman will not produce results. Apply these principals to your real data and API

Example of headers and Send button

Success!?

If our response is a success we’ll see: Status 200 OK (below the request body in the upper right corner of the response section)…

Sample successful response code

… and the response may be something like this:

Sample successful response

As we can see the loan was pre-approved and we received an account number and amount in the params.

Not-a-success!?

If our response is not successful we may see something like Status 500 Internal Server Error

Sample response code error

… and the response may be something like this:

Sample response error message

Troubleshooting

  1. Remember that even if a specific SOAPAction is not required by the API, the header may still be necessary for the request to work.
  2. If you are using a timestamp, be sure it meets the specs from the API docs. Check that it is set to GMT and on a 24 hour cycle (i.e. if it’s afternoon, it should read 15:30, not 3:30).
  3. Also, make sure the timestamp is current. Timestamps are used to ensure the request is current and the request may be denied if the timestamp is even a few minutes old.
  4. If you are using a nonce, make sure it is unique with each request.
  5. Check the SOAP message format.
  6. Ensure that the schema URLs are correct.
  7. 99% of my errors are typos and incorrect spelling.

We hope this helps!

Please feel free to leave kind comments, suggestions, corrections and better solutions!

--

--