Highlighted
Absent Member.
Absent Member.
286 views

SOAP Driver: Response document XPATH


I am working with a SOAP driver. From Subscriber channel I am sending
request documents and getting response in Input transformation. The
XPATH I am using for checking response document is behaving odd.
When I am using this XPATH:
Code:
--------------------
self::SOAP-ENV:Envelope/SOAP-ENV:Body
--------------------
result is TRUE but
when I am using this XPATH:
Code:
--------------------
self::SOAP-ENV:Envelope/SOAP-ENV:Body/addResponse
--------------------
result is FALSE
addResponse is inside SOAP-ENV:Body. What is the problem?

This is my policy:

Code:
--------------------
<?xml version="1.0" encoding="UTF-8"?><policy xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<rule>
<description>Check status for add user request</description>
<comment xml:space="preserve">Check status for add user request</comment>
<conditions>
<and>
<if-xpath op="true">self::SOAP-ENV:Envelope/SOAP-ENV:Body</if-xpath>
</and>
</conditions>
<actions/>
</rule>
<rule>
<description>Check status for add user request1</description>
<comment xml:space="preserve">Check status for add user request1</comment>
<conditions>
<and>
<if-xpath op="true">self::SOAP-ENV:Envelope/SOAP-ENV:Body/addResponse</if-xpath>
</and>
</conditions>
<actions/>
</rule>
</policy>
--------------------


Here is the response:

Code:
--------------------
<nds dtdversion="2.0">
<source>
<product build="20120601_162440" instance="SOAP Driver Cerner" version="3.5.7">Identity Manager Driver for SOAP</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<addResponse requestID="1365232203787" status="success" xmlns="urn:oasis:names:tc:SPML:2:0">
<pso>
<psoID ID="3020281" targetID="millennium"/>
<data>
<ns1:personnel version="1.0" xmlns:ns1="urn:cerner:xmlns:security-provisioning">
<ns1:personName>
<ns1:firstName>Zamar</ns1:firstName>
<ns1:lastName>Zamal</ns1:lastName>
<ns1:displayName>Zamal , Zamar</ns1:displayName>
</ns1:personName>
<ns1:birthdate>1987-01-12T02:00:00-05:00</ns1:birthdate>
<ns1:account>
<ns1:username>ZZ0027</ns1:username>
<ns1:directoryIndicator>false</ns1:directoryIndicator>
<ns1:privilege assigned="true" name="Impersonate"/>
<ns1:privilege assigned="true" name="ManageAccounts"/>
<ns1:restriction assigned="true" name="PasswordExpired"/>
</ns1:account>
<ns1:personnelName>
<ns1:firstName>Zamar</ns1:firstName>
<ns1:lastName>Zamal</ns1:lastName>
<ns1:displayName>Zamal , Zamar</ns1:displayName>
</ns1:personnelName>
<ns1:physicianInd>false</ns1:physicianInd>
<ns1:position>107822457</ns1:position>
<ns1:beginEffectiveDateTime>2013-03-12T04:00:00-04:00</ns1:beginEffectiveDateTime>
<ns1:endEffectiveDateTime>2013-05-31T04:00:00-04:00</ns1:endEffectiveDateTime>
</ns1:personnel>
</data>
</pso>
</addResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</output>
</nds>
[04/06/13 03:10:04.394]:Cerner ST: Applying input transformation policies.
[04/06/13 03:10:04.394]:Cerner ST: Applying policy: %+C%14Cpub-itp-check-status%-C.
[04/06/13 03:10:04.394]:Cerner ST: Applying to SOAP-ENV:Envelope #1.
[04/06/13 03:10:04.395]:Cerner ST: Evaluating selection criteria for rule 'Check status for add user request'.
[04/06/13 03:10:04.395]:Cerner ST: (if-xpath true "self::SOAP-ENV:Envelope/SOAP-ENV:Body") = TRUE.
[04/06/13 03:10:04.395]:Cerner ST: Rule selected.
[04/06/13 03:10:04.395]:Cerner ST: Applying rule 'Check status for add user request'.
[04/06/13 03:10:04.395]:Cerner ST: Evaluating selection criteria for rule 'Check status for add user request'.
[04/06/13 03:10:04.395]:Cerner ST: (if-xpath true "self::SOAP-ENV:Envelope/SOAP-ENV:Body/addResponse") = FALSE.
[04/06/13 03:10:04.396]:Cerner ST: Rule rejected.
[04/06/13 03:10:04.396]:Cerner ST: Policy returned:

--------------------


--
raktimb
------------------------------------------------------------------------
raktimb's Profile: https://forums.netiq.com/member.php?userid=4402
View this thread: https://forums.netiq.com/showthread.php?t=47482

Labels (1)
0 Likes
2 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: SOAP Driver: Response document XPATH

raktimb wrote:

> What is the problem?


Namespaces. addResponse is in the "urn:oasis:names:tc:SPML:2:0" namespace:

<addResponse requestID="1365232203787" status="success"
xmlns="urn:oasis:names:tc:SPML:2:0">

so you'll have to define a prefix for it in your policy:

xmlns:oasis="urn:oasis:names:tc:SPML:2:0"

and test using the prefix:

<if-xpath
op="true">self::SOAP-ENV:Envelope/SOAP-ENV:Body/oasis:addResponse</if-xpath>

Cheers, Lothar
______________________________________________
https://www.is4it.de/identity-access-management
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: SOAP Driver: Response document XPATH


Thank you. Problem solved. 😄


--
raktimb
------------------------------------------------------------------------
raktimb's Profile: https://forums.netiq.com/member.php?userid=4402
View this thread: https://forums.netiq.com/showthread.php?t=47482

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.