webService Connector Response

Hello

Our goal is to provision an account to an end point, read the response from the end point and populate the link with some data in the response.

I am having some trouble parsing the response to get the value needed. The account is created and the response comes back.

The code snippet below shows we’re getting the data and trying to print out values. The entire response prints out. I’ve tried multiple ways to grab a specific value but keep getting different parse errors.

I am hoping someone can point me in the right direction on this one.

import connector.common.JsonUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import sailpoint.object.Identity;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Map;


log.error("xxx Starting after operation rule");

log.error("xxx xxx xxx raw raw " + rawResponseObject);

Map response = (Map) JsonUtil.toMap(rawResponseObject);

log.error("**************response from WS after rule is ************** "+response);
log.error("**************requestEndPoint from WS after rule is ************** "+requestEndPoint);
log.error("**************processedResponseObject from WS after rule is ************** "+processedResponseObject);

if (response.get("items") != null) {

    itemsList = (ArrayList) response.get("items");

    log.error("xxx **************itemsList from WS after rule is ************** "+itemsList);

} else {
log.error("xxx get items was null");
}



log.error("xxx Ending after operation rule");

Hi @Seadog

Please share the error logs and also provide with sample response. Also let us know the value you are trying to extract from it.

Sure

Below is the data and the logs. I am trying to extract the id. In this case the value is 2945

2023-08-03T10:29:57,313 ERROR default task-133 connector.webservices.v2.RequestOrchestratorV2:166 - **************response from WS after rule is ************** {record={attachDocument=null, barcode=null, building=null, cellPhone=null, consolidatedMedicalReportDate=null, createdDate=08/03/2023 15:29, dateOfBirth=null, dateOfHire=05/21/xxxx, dateOfTermination=null, declaredPregnant=false, department={code=973989, description=BACTERIOLOGY, id=4498}, division={code=34, description=APHIS, id=64}, driverLicenseClass=null, driverLicenseNumber=null, driverLicenseState=null, ehs=false, email=null, emergencyContact=null, emergencyContactType=null, emergencyHomePhone=null, emergencyRelation=null, emergencyWorkPhone=null, employeeNumber=509420, employeeType={code=E, description=Federal Employee, id=8}, esr=false, estimatedConceptionDate=null, ethnicGroup=null, firstName=NICKALAUS, floorArea=null, fullName=xxxxx, NICKALAUS, fullNameAndNumber=xxxxx, NICKALAUS (509420), gender=null, geographicLocation={code=190230169, description=xxxx, AMES (STORY), id=66}, globalPassport=null, healthCenter={code=NCAH, description=National Centers for xxxxx, id=2}, healthInsurance=null, hipaaAuth=false, hipaaAuthDate=null, homeCity=Default City, homeCountry={code=USA, description=United States of America, id=204}, homeCounty=null, homePhone=null, homeState={code=xx, description=xxxx, id=15}, homeStreet1=null, homeStreet2=null, homeStreet3=null, homeZip=50021, hourlyRate=null, id=2945, jobPosition={code=xxxx, description=BIOLCL SCI LAB TECHNCN (MICRBIOLGY), id=629}, jobPositionGroup={code=0404, description=Biological science technician, id=225}, jobType=null, language=null, lastName=WUNSCHEL, location=null, loginId=null, maidenName=null, mailStop=null, maritalStatus=null, medicalInsuranceNumber=null, medicalRecordNumber=null, middleName=RODNEY-LOYDD, modifiedDate=null, monthlyWorkHours=0, motherFirstName=null, motherMaidenName=null, newce=null, newceUoM=null, nickName=null, organization=null, pager=null, photo=null, physician=null, physicianCity=null, physicianPhone=null, physicianState=null, physicianStreet=null, physicianZip=null, practitioner=null, preferredGender=null, secondaryContactName=null, secondaryEmail=null, secondaryPhoneNumber=null, seniorityDate=null, shiftCode=null, ssn=, supervisor=null, udF1=null, udF10=null, udF11=null, udF12=null, udF13=null, udF14=null, udF15=null, udF16=null, udF2=null, udF3=null, udF4=null, udF5=null, udF6=null, udF7=null, udF8=null, udF9=null, udfEmployee1=null, udfEmployee2=null, union=null, workExtension=null, workPhone=null, workStatus={code=A, description=Active Employee, id=1}}, subList=null}


Parsed Response:-
Exception Message: BeanShell script error: bsh.ParseException: Parse error at line 23, column 15.  Encountered: < BSF info: USDA-Rule-AfterOperation-xxxxx at line: 0 column: columnNo
sailpoint.tools.GeneralException: BeanShell script error: bsh.ParseException: Parse error at line 23, column 15.  Encountered: < BSF info: USDA-Rule-AfterOperation-xxxxx at line: 0 column: columnNo
	at sailpoint.server.BSFRuleRunner.runRule(BSFRuleRunner.java:219) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.server.InternalContext.runRule(InternalContext.java:1262) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.server.InternalContext.runRule(InternalContext.java:1234) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.connector.DefaultConnectorServices.runRule(DefaultConnectorServices.java:107) ~[identityiq.jar:8.2p2]
	at sailpoint.connector.DefaultConnectorServices.runRule(DefaultConnectorServices.java:138) ~[identityiq.jar:8.2p2]
	at sailpoint.connector.CollectorServices.runRule(CollectorServices.java:1003) ~[connector-bundle-identityiq.jar:8.2p2]
	at sailpoint.connector.webservices.v2.RequestOrchestratorV2.handleAfterOperationRule(RequestOrchestratorV2.java:644) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at sailpoint.connector.webservices.v2.RequestOrchestratorV2.processAfterRequest(RequestOrchestratorV2.java:450) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at connector.sdk.webservices.ExecutionMediator.processEndpoint(ExecutionMediator.java:669) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at connector.sdk.webservices.ExecutionMediator.process(ExecutionMediator.java:349) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at connector.sdk.webservices.ExecutionMediator.process(ExecutionMediator.java:196) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at sailpoint.connector.webservices.v2.WebServiceFacadeV2.create(WebServiceFacadeV2.java:952) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at sailpoint.connector.webservices.v2.WebServiceFacadeV2.provision(WebServiceFacadeV2.java:498) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at sailpoint.connector.webservices.WebServicesConnector.provision(WebServicesConnector.java:111) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at sailpoint.connector.ConnectorProxy.provision(ConnectorProxy.java:1113) ~[connector-bundle-identityiq.jar:8.2p2]
	at sailpoint.integration.ConnectorExecutor.provision(ConnectorExecutor.java:160) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.provisioning.PlanEvaluator.provision(PlanEvaluator.java:1617) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.provisioning.PlanEvaluator.execute(PlanEvaluator.java:958) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.provisioning.PlanEvaluator.execute(PlanEvaluator.java:843) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.provisioning.PlanEvaluator.execute(PlanEvaluator.java:737) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Provisioner.execute(Provisioner.java:1730) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.workflow.IdentityLibrary.provisionProject(IdentityLibrary.java:3180) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at sailpoint.server.ScriptletEvaluator.doCall(ScriptletEvaluator.java:134) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.server.ScriptletEvaluator.evalSource(ScriptletEvaluator.java:63) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.evalSource(Workflower.java:5910) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advanceStep(Workflower.java:5149) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advance(Workflower.java:4536) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.startCase(Workflower.java:3122) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.launchSubcase(Workflower.java:5452) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.launchSubcases(Workflower.java:5345) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advanceStep(Workflower.java:5136) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advance(Workflower.java:4536) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.startCase(Workflower.java:3122) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.launchSubcase(Workflower.java:5452) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.launchSubcases(Workflower.java:5345) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advanceStep(Workflower.java:5136) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advance(Workflower.java:4536) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advanceSubcase(Workflower.java:5476) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advanceStep(Workflower.java:5069) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.advance(Workflower.java:4536) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.assimilate(Workflower.java:4186) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.handleWorkItem(Workflower.java:7613) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.process(Workflower.java:1834) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.Workflower.process(Workflower.java:1858) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.api.WorkflowSession.advance(WorkflowSession.java:468) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.service.WorkflowSessionService.advance(WorkflowSessionService.java:105) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.service.ApprovalWorkItemService.complete(ApprovalWorkItemService.java:243) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.rest.ui.ApprovalWorkItemResource.complete(ApprovalWorkItemResource.java:121) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:366) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:319) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.opentracing.contrib.jaxrs2.server.SpanFinishingFilter.doFilter(SpanFinishingFilter.java:52) ~[opentracing-jaxrs2-0.4.1.redhat-00006.jar!/:?]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at sailpoint.web.SailPointResponseFilter.doFilter(SailPointResponseFilter.java:77) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at sailpoint.rest.jaxrs.MethodOverrideFilter.doFilter(MethodOverrideFilter.java:90) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at sailpoint.rest.RestCsrfValidationFilter.doFilter(RestCsrfValidationFilter.java:71) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at sailpoint.rest.AuthenticationFilter.doFilter(AuthenticationFilter.java:103) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at sailpoint.web.SailPointContextRequestFilter.doFilter(SailPointContextRequestFilter.java:61) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at sailpoint.web.SailPointPollingRequestFilter.doFilter(SailPointPollingRequestFilter.java:151) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at sailpoint.web.ResponseHeaderFilter.doFilter(ResponseHeaderFilter.java:63) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[connector-bundle-webservices.jar:8.2-SNAPSHOT]
	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) ~[?:?]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:53) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:59) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) ~[?:?]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68) ~[?:?]
	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105) ~[?:?]
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1504) ~[?:?]
	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) [undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) [undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) [undertow-servlet-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) [undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) [undertow-core-2.0.28.SP1-redhat-00001.jar!/:2.0.28.SP1-redhat-00001]
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) [jboss-threads-2.3.3.Final-redhat-00001.jar!/:2.3.3.Final-redhat-00001]
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982) [jboss-threads-2.3.3.Final-redhat-00001.jar!/:2.3.3.Final-redhat-00001]
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) [jboss-threads-2.3.3.Final-redhat-00001.jar!/:2.3.3.Final-redhat-00001]
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) [jboss-threads-2.3.3.Final-redhat-00001.jar!/:2.3.3.Final-redhat-00001]
	at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: org.apache.bsf.BSFException: BeanShell script error: bsh.ParseException: Parse error at line 23, column 15.  Encountered: < BSF info: USDA-Rule-AfterOperation-xxxxx at line: 0 column: columnNo
	at bsh.util.BeanShellBSFEngine.eval(BeanShellBSFEngine.java:202) ~[bsh-2.1.8.jar:2.1.8 2018-10-02 08:36:04]
	at org.apache.bsf.BSFManager$5.run(BSFManager.java:445) ~[bsf.jar:?]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.apache.bsf.BSFManager.eval(BSFManager.java:442) ~[bsf.jar:?]
	at sailpoint.server.BSFRuleRunner.eval(BSFRuleRunner.java:245) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	at sailpoint.server.BSFRuleRunner.runRule(BSFRuleRunner.java:216) ~[identityiq.jar:8.2p2 Build b9a7ae198e1-20220302-182712]
	... 151 more

@Seadog

Can you please share the rawResponseObject value as well?

Can you change the line:

for (Map.Entry<String, Object> entry : response.entrySet()) {

to

for (Map.Entry&lt;String, Object> entry : response.entrySet()) {

The code is not XML-encoded :wink:

– Remold

Hi @Seadog

Please remove the Generics from the rule and try again. Something like below

Map response = (Map) JsonUtil.toMap(rawResponseObject);

log.error("**************response from WS after rule is ************** "+response);


if (response != null) {

for (Map.Entry entry : response.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();

log.error(key + ": " + value);


} else {

log.error("xxx data was null");
}

xxx xxx xxx raw raw {
“record”: {
“attachDocument”: null,
“barcode”: null,
“building”: null,
“cellPhone”: null,
“consolidatedMedicalReportDate”: null,
“createdDate”: “08/04/2023 10:44”,
“dateOfBirth”: null,
“dateOfHire”: “10/11/xxxx”,
“dateOfTermination”: null,
“declaredPregnant”: false,
“department”: {
“code”: “xxxx”,
“description”: “xxxx”,
“id”: xxxx
},
“division”: {
“code”: “34”,
“description”: “xxxx”,
“id”: xx
},
“driverLicenseClass”: null,
“driverLicenseNumber”: null,
“driverLicenseState”: null,
“ehs”: false,
“email”: null,

"id": 2951,
"jobPosition": {
  "code": "xxxx",
  "description": "xxxx",
  "id": xxx
},
"jobPositionGroup": {
  "code": "xxxx",
  "description": "xxxx",
  "id": xxx
},

},
“subList”: null
}

2 Likes

Hi @Seadog

You can try the below code snippet to fetch the id value from the shared response.

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

    if (rawResponseObject != null) {
      JsonObject jsonObject = new JsonParser().parse(rawResponseObject).getAsJsonObject();
      JsonObject response = jsonObject.get("record").getAsJsonObject();
      int id = response.get("id").getAsInt();
    }

Thanks for your help. It got me on the right track.

This is what finally worked.

String jsonResponse = rawResponseObject.toString();
log.error("xxx jsonRespons " + jsonResponse);

JSONObject jsonObject = new JSONObject(jsonResponse);
log.error("xxx jsonObject " + jsonObject);

for (String key : jsonObject.keys()) {
Object value = jsonObject.get(key);
log.error("Key: " + key + ", Value: " + value);

}


//access the id value
int id = jsonObject.getJSONObject("record").getInt("id");


log.error("xxx id " + id);
1 Like

Good to see it is working :slight_smile:

Would you be so kind to mark @Jarin_James last reply as solution? This will help others in the future with a similar question/issue to see your issue has been resolved.

Thanks,
Remold

1 Like

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