Genesys Cloud only supports communicating with REST based APIs, it can be a challenge to integrate with applications that only provide SOAP based APIs. SOAP Adapter helps to close that gap. It acts as the middleware between an application that only supports REST and an API that only supports SOAP. This installation wizard creates a Genesys cloud action with necessary parameters and that can be used in a Genesys Cloud call flow.
SOAP Adapter comes with a sample "SOAP Adapter" data action. This data action does not have an "Output Contract". Please use sample data action to define data action with "Output Contract" matching your data response definition.
The JSON attributes that must be populated in the request body to the service follow the same naming as the WSDL objects. It is a necessity to have WSDL knowledge prior to using SOAP Adapter.
Payload Structure | Description |
---|---|
wsdl | Full qualified URL to the SOAP WSDL document. Typically ends in ?WSDL |
port | The interface containing the collection of operations |
service | Service name of operation |
operation | The SOAP method to be invoked |
soapAction | SOAPAction property of the service/operation |
input | Name of the data structure containing the input parameters |
args | Data object of the input parameters to the SOAP operation |
httpHeaders |
List of Http headers (key, value pairs) to be sent with the SOAP request Basic Authentication: "auth": { "username":"<username>", "password":"<password>" } |
soapHeaders |
Accepts key-value pairs and sets the headers in the SOAP Envelope of request. "soapHeaders": { "key1":"Value1", "Key2":"Value2" . . } |
wsSecurity |
SOAP Adapter supports sending WS Security authentication headers in the SOAP header to connect with
the SOAP service that requires WS-Security authentication. "wsSecurity": { "username":"<username>", "password":"<password>" "passwordType": "PasswordText", "hasTimeStamp":true, "hasTokenCreated":true, "hasNonce",true, "mustUnderstand":true, "actor":"xxx" }username is the mandatory field. Other fields are optional. The allowed values for ‘passwordType’ are 'PasswordText' and 'PasswordDigest'. By default, it is 'PasswordText'. The options hasTimeStamp, hasTokenCreated, hasNonce, mustUnderstand are by default 'false'. When it is set to true, the corresponding values will be set in the SOAP header. Default value for 'actor' is ''. |
forceSoap12Headers |
By default, app sets SOAP 1.1 headers. When this option is enabled, it sends SOAP 1.2 headers in the
request. It accepts boolean values true or false. |
envelopeNamespacePrefix |
Prefixes to be masked in the response body. It accepts '|' separated string. By default, SOAP Adapter masks “soap-env:, soap:, env:, ns1:” namespace prefix occurrences in the response body. If anything, other than the above-mentioned namespace prefixes to be masked, that can be mentioned in this attribute. Ex: "soa-env:|a:|b:" |
rootNamespaces |
Sometimes requestBody may refer additional namespaces other than tns (target namespace). This option
allows to add additional namespaces to add to SOAP Body root. So that, it can be mentioned in the
args. Format: "rootNamespaces": { "<NamespacePrefix1>":"<Namespace1>", "<NamespacePrefix2>":"<Namespace2>", . . }Ex: "rootNamespaces": { "moex":"http://schemas.datacontract.org/2004/07/ExlWebService", "wsa":"http://www.w3.org/2005/08/addressing" } "args": { "auditInfo": { "moex:IpAdd": "10.1.1.1", "moex:IsStr": "N", "moex:Username": "xxx" }, "source": "IVR" } |
Request Body |
---|
{ "wsdl": "https://soapserviceprovider.com/soap/service.asmx?WSDL", "operation": "GetInformation", "service": "GetInformationWebService", "port": "GetInformationWebServiceSoap", "input":"GetInformationParamSet", "soapAction":"http://schemas.soapserviceprovider.com /soap/2.0.0/GetInformation/GetInformationParamSet" "args": { "param1": "<example-phone number>", "param2": "<example-customer segment>" }, "httpHeaders": { "auth": { "username":"<username>", "password":"<password>" }, "headerKey1": "<header-value>", "headerKey2": "<header-value>" } } |
Response |
---|
{ "status": 200, "soapResponse": { " GetInformationParamSet ": { "Result": true, "ErrorMessage": "" } } } |
Sample Request Body with soapHeaders and wsSecurity options |
---|
{ "wsdl": "https://soapserviceprovider.com/soap/service.asmx?WSDL", "operation": "GetInformation", "service": "GetInformationWebService", "port": "GetInformationWebServiceSoap", "input":"GetInformationParamSet", "soapAction":"http://schemas.soapserviceprovider.com /soap/2.0.0/GetInformation/GetInformationParamSet" "args": { "auditInfo": { "ex:IpInfo": "xxx", "ex:IsStr": "N", "ex:Username": "xxx" }, "source": "IVR", "ssn": "xxx" }, "rootNamespaces":{ "ex":"http://schemas.datacontract.org/2004/07/ExternalWebService", "wsa":"http://www.w3.org/2005/08/addressing" }, "forceSoap12Headers" : true, "envelopeNamespacePrefix": "s:|b:|c:", "soapHeaders":{ "wsa:Action":"http://tempuri.org/GetXXX", "wsa:To":"https://sss:7021/ExternalWebService/xxx.svc" }, "wsSecurity":{ "username": "xxx", "password": "yyy", "hasTokenCreated":true } } |
Once the Contract and Configuration have been defined, it's critical to use the Test tab to test the custom action. You'll fill in the available Input parameters, uncheck 'Flatten output', then click 'Run Action'. You should see it return a success response and populate the properties defined in the Output Contract if the response does in fact include values for those properties.
In Architect, this new custom data action can be used in a Task element. Inside the task, a Call Data Action element can be used to trigger this new custom data action. When you choose it, you should see all the input and output parameters defined in the action contract.
You'll define all the input values to pass to the request, whether these are hard coded values or collected in a variable somewhere else in the call flow. You'll also assign the success outputs to variables for use later in the call flow.
Learn more about using Call Data Action elements in Architect here: https://help.mypurecloud.com/articles/call-data-action/