<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Make an HTTP Call Using SOAP in Workflows
Okta Classic Engine
Okta Identity Engine
Workflows

Overview

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

Solution

This KB uses the Number Conversion Service, 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 calls 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.
 

Related References

 

 

Loading
Make an HTTP Call Using SOAP in Workflows