RPC Returning a List to the response attributes

Which IIQ version are you inquiring about?

8.3p3

Share all details about your problem, including any error messages you may have received.

For reference, review Running Powershell direct via IQService

Has anyone successfully returned a list in the response?

Example returning a string (Powershell side):

$resultObject = New-Object SailPoint.Utils.objects.ServiceResult
$resultObject.Attributes["FunTimes"]="TRUE"

Reading that value (beanshell side):

RpcResponse response = service.execute(request);
String funTimes=response.getResultAttributes.get("FunTimes");

Example attempting to return a list (Powershell side):

Get-ChildItem -Directory -Path $path | Select-Object -Property Name | Tee-Object -Variable folderList
$resultObject.Attributes["FolderList"]=$folderList

Attempt to read (beanshell side):

Object folderListObj=response.getResultAttributes.get("FolderList");
List folderList=(List)folderListObj;

folderListObj is a PersistentArrayList (meaning that PS did send a list) but the list is EMPTY.

Has anyone successfully returned a List or a Map in the SailPoint.Utils.objects.ServiceResult object?

1 Like

Seems like it’s only allowing Strings. If that’s the case I might just send a single JSON string over and then pick it apart in the beanshell. That would require having the Powershell 7 conversion methods available.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.