Hyphens in SoapResponseData Variables

book

Article ID: 5351

calendar_today

Updated On:

Products

CA Process Automation Base

Issue/Introduction

Certain CA IT PAM Web Service methods (for example, "GetFlowState"), create SoapResponseData variables with hyphens ("-") (for example, flow-state, submission-time, sender-address, and connection-id). The hyphen causes syntax problems when the variables are referenced (i.e. in post-execution).  You may see an error like this:

 

Error in post-execution code. Failed to execute code:

Process.process_status_result=Process.Invoke_SOAP_Method_2.SoapResponseData.CheckFlowResult[0].flow-state[0].text_;

 -- ReferenceError: "state" is not defined. (#4)

Environment

Release: ITPASA99000-4.3-Process Automation-Add On License for-CA Server Automation
Component:

Resolution

Use alternate syntax to access values. For example, use:

SoapOperator.SoapResponseData.CheckFlowResult[0]["flow-state"][0].text_;

instead of

SoapOperator.SoapResponseData.CheckFlowResult[0].flow-state[0].text_;

 

Notice that the period before flow-state is removed and the brackets and quotes are added around flow-state.  This syntax will work and prevent the above error.