Hello,
I have a SOAP Request that I am trying to get the out parameters as variables but every time I run the workflow it is successful but I am not able to assign the out variables as parameters (but if I assign the parameter and do a system.log it works but it doesn't work if I want to use the result as a variable for another part of the workflow)
Here is the Output:
[2015-04-30 14:31:30.437] [I] processing response...
[2015-04-30 14:31:30.437] [I] out headers...
[2015-04-30 14:31:30.468] [I] out parameters...
[2015-04-30 14:31:30.475] [I] out parameters available:
[2015-04-30 14:31:30.476] [I] + parameter name: 'GetRequestStatusResult', value: '<Response>
<OutputParameters>
<ServiceRequestID>SR145208</ServiceRequestID>
<ServiceRequestStatus>DEPLOYING OS</ServiceRequestStatus>
<ServiceRequestCreated>4/20/2015 5:57:59 PM</ServiceRequestCreated>
<ServiceRequestCompleted></ServiceRequestCompleted>
<CurrentActivity>MA145212</CurrentActivity>
<CurrentActivityTitle>DEPLOYING OS</CurrentActivityTitle>
<ActivityStartUTC></ActivityStartUTC>
<ActivityEndUTC></ActivityEndUTC>
<DurationTotalSeconds></DurationTotalSeconds>
<AverageDurationSeconds></AverageDurationSeconds>
<SecondsOffAverage></SecondsOffAverage>
<EstimatedCompletionUTC></EstimatedCompletionUTC>
</OutputParameters>
<Warnings></Warnings>
<Exceptions></Exceptions>
</Response>'
[2015-04-30 14:31:30.478] [I] + parameter attribute name: '.(xmlns)', value: 'http://SystemCenter.JPMChase.net/'
Here is my scriptable task:
var getRequestStatusResult = outParameters.get("GetRequestStatusResult");
var content = getRequestStatusResult; // the XML text value of GetRequestStatusResult parameter above ( '<Response> ... </Response>' )
var doc = new XML(content); // parse the whole response
serviceRequestNumber = doc.OutputParameters.ServiceRequestID;
Service_RequestStatus = doc.OutputParameters.ServiceRequestStatus;
serviceRequestCreated = doc.OutputParameters.ServiceRequestCreated;
serviceRequestCompleted = doc.OutputParameters.ServiceRequestCompleted;
currentActivity = doc.OutputParameters.CurrentActivity;
currentActivityTitle = doc.OutputParameters.CurrentActivityTitle;
activityStartUTC = doc.OutputParameters.ActivityStartUTC;
activityEndUTC = doc.OutputParameters.ActivityEndUTC;
durationTotalSeconds = doc.OutputParameters.DurationTotalSeconds;
averageDurationSeconds = doc.OutputParameters.AverageDurationSeconds;
secondsOffAverage = doc.OutputParameters.SecondsOffAverage;
estimatedCompletionUTC = doc.OutputParameters.EstimatedCompletionUTC;