WebServices | Account Aggregation | Mapping of XML Response

Hello,
I need help in understanding how to Map an XML Response from a WS Account Aggregation.

For example if the response body looked like this, (using Tableau API Response for example only)

<?xml version='1.0' encoding='utf-8'?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api https://help.tableau.com/samples/en-us/rest_api/ts-api_3_4.xsd">
	<pagination pageNumber="1" pageSize="100" totalAvailable="28"/>
	<users>
		<user authSetting="TableauIDWithMFA" email="[email protected]" externalAuthUserId="957b154e394023dbcf3105bcf3fc790102bea54d5486839954b5b5246b1c3938" fullName=". [email protected]" id="98777636-1c8b-4824-97b9-ef5053ad82cb" name="[email protected]" siteRole="Explorer">
			<domain name="TABID_WITH_MFA"/>
		</user>
		<user authSetting="TableauIDWithMFA" email="[email protected]" externalAuthUserId="1ef8bf09f798e71129f6ceb8e603b35ad53d02fa38306f1d12543799dc98cbad" fullName=". [email protected]" id="817510dc-44a1-4082-a7f0-8d7451d03fd7" name="[email protected]" siteRole="Unlicensed">
			<domain name="TABID_WITH_MFA"/>
		</user>
		<user authSetting="TableauIDWithMFA" email="[email protected]" externalAuthUserId="22521ce2f36c254b8ae1a63aa092c5625a093c6c8583e7202e33938d58bdf5f0" fullName=". [email protected]" id="e12c72ae-47c8-42e3-9ffb-c30bfdf2ad15" name="[email protected]" siteRole="Unlicensed">
			<domain name="TABID_WITH_MFA"/>
		</user>
	</users>
</tsResponse>

how should the following be configured:

  • Response Information
  • Response Mapping
  • XPath Namespace Mapping
    Assuming I need to record id, email, fullName and siteRole for each user
1 Like

Hi @iamnithesh, I’ll try to help here, but bear in mind I’m new to SailPoint and my only experience with the WebServices connector has been with the SaaS equivalent parsing a JSON payload. From what I read the XPath Namespace is only required if the nodes are using some special/non-standard XML format, but your XML looks like a very straightforward one, so I would suggest to try the below.

Response Information
(where you configure your root & http success codes):

  1. Root:
//tsResponse/users/user
  1. Success code(s):
    This is usually 200, but if your app retrieves other 2xx codes, you can add multiple by typing the 2xx number and then ENTER, like so:
    image

Response Mapping
On the left column (Schema Attribute)
id
email
fullName
siteRole

On the right column (Attribute path)
@id
@email
@fullName
@siteRole

I hope that helps!

Elisa.

1 Like

Thanks @eabedrapo1

I tried this, but zero accounts are scanned. I have logged the response body and I was getting the same XML every time I tried. I am not able to wrap my head around what is missing!! :exploding_head:

1 Like

Sometimes a leading . before // helps. So in your case, you may want to try .//tsResponse.

Years ago when I worked with Firebug to extract XPath expressions to insert in my Selenium scripts I had similar problems (element not found) and after adding that leading dot my problems were resolved. Not sure if that would help in this case.

By the way, I found this good site to test XPath expressions out of XML files.

Edit:
Oh! and I also realized in my previous post I didn’t include the / after user… so the root expression should be:

//tsResponse/users/user/

OR (if the one with no leading dot still doesn’t work)

.//tsResponse/users/user/

I hope that helps!

1 Like

Thanks for sharing this…

I still have the issue… but not going to waste my weekend over it :smiley: Will be checking tomorrow

1 Like

You were right the first time!!! My configuration had an issue in the Header setting that I did not realize until now :neutral_face:

2 Likes

I’m glad you found the issue! Thanks for marking my suggestion as the solution to your problem though, I’m happy to help!

2 Likes

What headers did you use , please mention. I am also facing the similar issue.

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