Not able to call IQ service to fetch data from Microsoft Exchange

I am calling this rule but unable to get into IQ service
Sharing the code here

public RpcResponse callIQService(Map data, String rpcService,String iqServiceHost, int iqServicePort) throws Exception{

if (iqServiceHost == null || iqServiceHost.isEmpty()) {
  
  return null;
}
try {
  
  RPCService service = new RPCService(iqServiceHost, iqServicePort);
  
  RpcRequest request = new RpcRequest(rpcService, "runAfterScript", data);
  
  RpcResponse response = service.execute(request);
  if (response == null) {
  
    return null;
  }
  log.error("? Inside call IIQ service response object print: " + response);
  return response;

It is not getting into this loop.
Please suggest if something is missing

Hi,

Please try the following:

import sailpoint.object.RpcRequest;
import sailpoint.object.RpcResponse;
import sailpoint.connector.RPCService;

import sailpoint.object.Application;
import sailpoint.object.Rule;

import sailpoint.tools.Util;


Rule rule = context.getObjectByName(Rule.class, "YOUR_PS_RULE");

// Add your parameters
String applicationName = "AD_APPLICATION_NAME";
Application application = context.getObjectByName(Application.class, applicationName);
Map iqservicemap = application.getAttributeValue("IQServiceConfiguration").get(0);

String iqServiceHost = iqservicemap.get("IQServiceHost");
int iqServicePortI = Util.otoi(iqservicemap.get("IQServicePort"));
boolean useTLS = iqservicemap.get("useTLSForIQService");

Map data = new HashMap();
data.put("postScript", rule);
data.put("Application", application.getAttributes());
data.put("Request", accountRequest);
RPCService service = new RPCService(iqServiceHost, iqServicePortI, false, useTLS);
service.setConnectorServices(new sailpoint.connector.DefaultConnectorServices());
RpcRequest request = new RpcRequest("ScriptExecutor", "runAfterScript", data);
service.execute(request);
1 Like

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