Web Services SOAP XML Account Aggregation issues with Response < >

Account aggregation for web service source is showing success with account scanned “0”.
Below is the postman response:

I have tried all the possible possibilities of root path, namespace prefix, and Response mapping. Also tried Web Service after operation rule. Yet there is no success at all.
Headers:
SOAPAction urn:ImportIntf-DataImport#RetrieveUsers
Content-Type text/xml

Possible Root Path
//NS1:return/NS1:Response/NS1:RetrieveUserResults/NS1:Users_Info/NS1:User_Data

OR

//NS1:RetrieveUsersResponse/return/Response/RetrieveUserResults/Users_Info/User_Data

//return/Response/RetrieveUserResults/Users_Info/User_Data

Also tried User_Data[*] in above root path

Below is Response Mapping

Any suggestions?Preformatted text

Hi @Pabka,

Is it possible for you to share the response xml rather than screenshot so that I can try it at my end. Please remove all the sensitive data from it.

Thanks

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS1="urn:ImportIntf-DataImport">
        <NS1:RetrieveUsersResponse>
            < return xsi:type="xsd:string" >
			&lt;Response&gt;
			&lt;InfoMsg&gt;Users have been successfully retrieved&lt;/InfoMsg&gt;
			&lt;RetrieveUserResults&gt;
			&lt;Users_Info&gt;
			&lt;User_Data&gt;
			&lt;UserID&gt;[email protected]&lt;/UserID&gt;&lt;FirstName&gt;JON&lt;/FirstName&gt;&lt;LastName&gt;DOE&lt;/LastName&gt;
			&lt;/User_Data&gt;
			&lt;User_Data&gt;
			&lt;UserID&gt;[email protected]&lt;/UserID&gt;&lt;FirstName&gt;DAENERYS&lt;/FirstName&gt;&lt;LastName&gt;KUMARI&lt;/LastName&gt;
			&lt;/User_Data&gt;
			&lt;/Users_Info&gt;
			&lt;/RetrieveUserResults&gt;
			&lt;/Response&gt;
			</return>
        </NS1:RetrieveUsersResponse>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Hi @Pabka,

Can you try below xpath’s .

/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data/FirstName
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data/LastName
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data/UserID
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data[2]
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data[2]/FirstName
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data[2]/LastName
/SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/Response/RetrieveUserResults/Users_Info/User_Data[2]/UserID

Thanks

Hi @Pabka,

You may try below rootPath and xPath and response mapping.

RootPath:

.//SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveUsersResponse/return/Response/RetrieveUserResults/User_Info/User_Data

Response Mapping:

User_ID: UserID
FirstName: FirstName
LastName: LastName

Xpath:

xmlns:xsd : http://www.w3.org/2001/XMLSchema
xmlns:xsi : http://www.w3.org/2001/XMLSchema-instance
xmlns:SOAP-ENV : http://schemas.xmlsoap.org/soap/envelope

Thank You.

@gogubapu

The following is the error with your suggestion

Error

sailpoint.connector.ConnectorException: Error: Error extracting response from XML

@ashutosh08

I get the error “sailpoint.connector.ConnectorException: Error: Error extracting response from XML”

It looks like response is xml inside xml and needs parsing, any suggestion?

The ccg log is below after replacing escape character in rawResponseObject from after Operation rule. The rule is not able to replace all escape character:

<?xml version=\"1.0\"?>\r\n
<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http:\/\/schemas.xmlsoap.org\/soap\/envelope\/\" xmlns:xsd=\"http:\/\/www.w3.org\/2001\/XMLSchema\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xmlns:SOAP-ENC=\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\">
    <SOAP-ENV:Body SOAP-ENV:encodingStyle=\"http:\/\/schemas.xmlsoap.org\/soap\/encoding\/\" xmlns:NS1=\"urn:ImportIntf-IDataImport\">
        <NS1:RetrieveUsersResponse>
            <return xsi:type=\"xsd:string\">
                <Response>
                    <InfoMsg>Users have been successfully retrieved<\/InfoMsg>
                        <RetrieveUserResults>
                            <Users_Info>
                                <User_Data>
                                    <UserID>JONBAHADUR<\/UserID>
                                        <FirstName>JON<\/FirstName>
                                            <LastName>BAHADUR<\/LastName>..............

AfterOperation rule is below

log.debug("==== rawResponseObject ==== " + rawResponseObject);
String convertedResponse = rawResponseObject
    .replace("&lt;", "<")
    .replace("&gt;", ">")
    .replace("\\r\\n", "")
    .replace("\\/", "/")
    .replace("\\\"", "\"")
    .replace("&quot;", "\"")
    .replace("&apos;", "'")
    .replace("&amp;", "&");

log.debug("=============convertedResponse=========== " + convertedResponse);
return convertedResponse;

Root path
//SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveRapportUsersResponse/return/Response/RetrieveUserResults/Users_Info/User_Data

The result is Account scanned “0”.

Any suggestion what I am missing in escape character? and rootpath?

Hi @Pabka,

Change rootPath to : .//SOAP-ENV:Envelope/SOAP-ENV:Body/NS1:RetrieveRapportUsersResponse/return/Response/RetrieveUserResults/Users_Info

in the rootpath dot is required.

Response Mapping:

User_ID: User_Data/UserID
FirstName: User_Data/FirstName
LastName: User_Data/LastName

Thank You.

@gogubapu

I changed it but still no account scanned.

Hi @Pabka,

You may try below code in After Operation rule:

log.info("==== rawResponseObject ==== " + rawResponseObject);
rawResponseObject =  rawResponseObject
				 .replace("&lt;", "<")
				.replace("&gt;", ">")
				.replace("\\r\\n", "")
				.replace("\\/", "/")
				.replace("\\\"", "\"")
				.replace("&quot;", "\"")
				.replace("&apos;", "'")
				.replace("&amp;", "&");
	 return rawResponseObject;

Thank You.

The escape characters are expected in ccg log except for & lt; and & gt; (which I parsed) for my response. Besides I passed root path and response mapping via After Operation rule.

Aggregation is working and scanning users. Thank you for your input