Make HTTP calls using the SOAP protocol

Postman can make HTTP calls using Simple Object Access Protocol (SOAP), a platform-independent messaging protocol specification. In this example, the SOAP endpoint changes numeric values into their text equivalents, from 500 to five hundred.

For more SOAP request examples, see the Public SOAP APIs collection.

Entering your SOAP endpoint

  1. If you haven't already, download and install the Postman desktop app.

  2. To open an HTTP request, select New > HTTP.

    Create new request
  3. Enter your SOAP endpoint URL in the address field. For this example, use the following endpoint URL: https://www.dataaccess.com/webservicesserver/NumberConversion.wso.

  4. Select POST from the request method dropdown list.

    SOAP method

Adding body data

  1. In the Body tab, select raw and choose XML from the dropdown list.

    SOAP body type
  2. Enter your XML in the text entry area. To test the number conversion SOAP API used in the previous section, enter the following XML in the text entry area:

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
       <NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/">
         <ubiNum>500</ubiNum>
       </NumberToWords>
      </soap:Body>
    </soap:Envelope>
    

    Your request body must include the SOAP Envelope, Header, and Body tags as required by the endpoint, as well as any namespaces. The data needs to include the name of the operation, together with any values you need to post to the service.

Setting your request headers

When you select an XML body type, Postman automatically adds a content type header of application/xml. But depending on your service provider, you may need text/xml for some SOAP requests. Check with your SOAP service to decide which header is appropriate. If you need the text/xml header, override the default setting added by Postman.

To set request headers, do the following:

  1. Open the request Headers. If the auto-generated headers are hidden, select hidden to display them.

  2. Clear the Content-Type header, which was automatically added.

  3. Add a new key-value pair, Content-Type and text/xml.

  4. Add another key-value pair, SOAPAction and "#MethodName"(in this example, "#POST").

    SOAP content type

Sending your request

Select Send to make your call to the SOAP service. If your call is successful, Postman displays the response in the lower tab.

SOAP response data

Last modified: 2023/6/30