Make an HTTP Call Using SOAP in Okta Workflows

In this guide:

  1. Okta Workflows guides
  2. HTTP call using SOAP
  3. Related Okta Workflows guides
  4. Okta Workflows resources

Okta Workflows guides

Okta Workflows guides are questions and answers from the community office hours, the #okta-workflows channel on MacAdmins Slack, and other places. Read all the other guides.

How to make an HTTP call using the SOAP protocol in Okta Workflows?

This guide will teach you to make an HTTP call using SOAP in Okta Workflows.

HTTP call using SOAP

This guide uses the Number Conversion Service, and specifically the NumberToWords endpoint (operation).

The service takes a number input and returns the string representation—for example, an input of 102 returns one hundred and two.

The following flow makes an HTTP call to a SOAP.

HTTP call to a SOAP service.

Flow steps

The flow has the following steps.

Flow input

The Helper Flow card sets up Input Number field as flow input.

Create XML body

The Compose card creates the XML service body.

<?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>Flow_input</ubiNum>
    </NumberToWords>
  </soap:Body>
</soap:Envelope>

Create HTTP header

The Object – Construct card creates the Content-Type HTTP header set to text/xml.

Make HTTP call

The API Connector – Raw Request card makes the call to the SOAP service.

Service’s response for input number 102:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <m:NumberToWordsResponse xmlns:m="http://www.dataaccess.com/webservicesserver/">
      <m:NumberToWordsResult>one hundred and two </m:NumberToWordsResult>
    </m:NumberToWordsResponse>
  </soap:Body>
</soap:Envelope>

Parse the XML response into JSON object

The XML response from the Raw Request card is parsed into a JSON object using the XML – Parse card. The JSON object looks like this:

{
  "$": {
    "xmlns:soap": "http://schemas.xmlsoap.org/soap/envelope/"
  },
  "soap:Body": [
    {
      "m:NumberToWordsResponse": [
        {
          "$": {
            "xmlns:m": "http://www.dataaccess.com/webservicesserver/"
          },
          "m:NumberToWordsResult": [
            "one hundred and two "
          ]
        }
      ]
    }
  ]
}

Get the result

In the last step, the Object – Get card gets the result using the soap:Body.0.m:NumberToWordsResponse.0.m:NumberToWordsResult.0 key.

Running the flow.

The Get card shows the service’s output: one hundred and two.

Okta Workflows resources

🍫 Get help from Workflows specialists during weekly community office hours.

📺 Learn from Workflows videos.

🛟 Get help from support: discuss a Workflows topic or ask a question.

🙋🏻‍♀️ Get help from the community: join the #okta-workflows channel on MacAdmins Slack.

Leave a comment