Web Service Connector

Hi Team,

Connector : Web Service Connector

HTTP Operation : GET : Account Aggregation

Issue : Pagination

Note: Response is in XML Format.

I have around 50k records in my target Application named as SkyZone.

Requirement:

Run the Aggregation and you will get “accessToken” in the response in the {{accessToken}} tag. and that “accessToken” we have to pass in the Header,

X-Continuation-Path : accessToken

for the next set of Account Aggregation till the time all Account has been aggregated.

Scenario:

When I am running the Account Aggregation it is fetching first 5000 Accounts and in the response we have “last” tag which contains token. That token we need to use in header of next call to fetch the Accounts.

  1. Can we perform it via only one HTTP Operation for Account Aggregation.
  2. Do we need to write After and Before Web Service Operation rules.
  3. Can we add more than one rules in single HTTP Operation.

Please suggest me the approach to resolve this issue.

here is the response format:

<?xml version="1.0" encoding="utf-8"?> cryzone-alert-raiser cryzone-checkin-raiser AC.Raj@test.uxi.ab Caitlin Raj cryzone:application=com.cryzoneapp cryzone_user:group=3mnfiz2kzpa this is the place where token exist

More Inputs:

Provide an empty string X-Continuation-Token header on the first request. If the response contains an X-Continuation-Token header, it can be used to request the next page by making the identical request again with the new token. If the response does not return an X-Continuation-Token header, then there are no more items

Hi Ritu,

The best way to handle this is using pagination. Please find the documentation for Web Service for the same.
Configuring Web Services for Integration

@RAKRHEEM

Thanks for your reply.

I have tried the pagination part.

Issue : I am getting the “accessToken” value in response which I have to use in header for my next aggregation, till the time we are not receiving any token details in “accessToken” field.

then you will need t generate the token in before-after operation rule

Sorry I didn’t understand

You can read the response headers from within an after operation rule, save them to transientValues, and use that to update the request headers in the next request using a before operation rule.

See methods:

  • getResponseHeaders()
  • setHeader(java.util.Map value)
  • addHeader(java.lang.String entry, java.lang.String value)

In this document it explains how to use transientValues to pass data between the before and after rules.

Matt

Here the scenario is :

In first aggregation call, I have to pass the “X-Continuation-Token” as empty, so that it will generate the “X-Continuation-Token” in the Response Headers.

That value from the Response Headers again I have to loop back in first call.

So there will be two Rules:

Before Operation :

Map body = requestEndPoint.getHeader();

body.put(“X-Continuation-Token”,“”);

log.info(“Rule - Modify Body: running faast” + body.toString());

return requestEndPoint;

Output: {Authorization=Basic abc, Accept=application/xml, Content-Type=application/xml, X-Continuation-Token=}

but when I am capturing the output in Web Service After Operation Rule:

I can’t see any token generated.

this is how I am passing the X-Continuation-Token in my first call and same solution I have to perform in SailPoint Web Service Before Operation Rule

Hi @ritu

in your case one token is sufficient to get all 50 records? if yes then go for custom auth operation to get the token and store in application attribute, then uses application attribute in header to call users Api.

nope, everytime it will return different X-Continuation-Token in header

Can we pass the header value as null?

import java.util.HashMap;

import java.util.Map;

import java.util.*;

import connector.common.JsonUtil;

import connector.common.Util;

import sailpoint.connector.webservices.EndPoint;

Map body = requestEndPoint.getHeader();

body.put(“X-Continuation-Token”,“”);

requestEndPoint.setHeader(body);

log.info(“Before Rule : To set X-Continuation-Token as Empty in first call1” + body);

return requestEndPoint;