iamnithesh
(Nithesh Rao)
August 26, 2023, 7:40pm
1
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
eabedrapo1
(Elisa Abedrapo)
August 26, 2023, 8:44pm
2
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):
Root:
//tsResponse/users/user
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:
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
iamnithesh
(Nithesh Rao)
August 27, 2023, 12:27am
3
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!!
1 Like
eabedrapo1
(Elisa Abedrapo)
August 27, 2023, 12:53am
4
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
iamnithesh
(Nithesh Rao)
August 27, 2023, 1:54pm
5
Thanks for sharing this…
I still have the issue… but not going to waste my weekend over it Will be checking tomorrow
2 Likes
iamnithesh
(Nithesh Rao)
August 31, 2023, 7:10pm
6
Elisa Abedrapo:
//tsResponse/users/user
You were right the first time!!! My configuration had an issue in the Header setting that I did not realize until now
2 Likes
eabedrapo1
(Elisa Abedrapo)
August 31, 2023, 10:10pm
7
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
nandiniks
(Nandini KS)
October 10, 2023, 7:37am
8
What headers did you use , please mention. I am also facing the similar issue.
system
(system)
Closed
December 9, 2023, 7:37am
9
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.