Adding association in SOAP driver


Hello,

I am creating objects with a SOAP driver on a remote system with a
webservice. When the create is done and i get a message back from the
server, indicating the create was successful, I want to add an
association in the driver.

I do it like so:


Code:
--------------------

<xsl:if test="$result//*[local-name()='AddDepartmentResult'] = 'true'">
<xsl:message>AddAssociation DeptID: <xsl:value-of select="$lDeptID"/>
<xsl:message>AddAssociation DN: <xsl:value-of select="$lDN"/></xsl:message>
<xsl:message>AddAssociation src-entry-id: <xsl:value-of select="$lSrcEntryID"/></xsl:message>
</xsl:message>
<xsl:variable name="add-association">
<add-association>
<xsl:attribute name="dest-dn">
<xsl:value-of select="$lDN"/>
</xsl:attribute>
<xsl:attribute name="event-id">0</xsl:attribute>
<xsl:attribute name="src-entry-id">
<xsl:value-of select="$lSrcEntryID"/>
</xsl:attribute>
<xsl:value-of select="$result//*[local-name()='AddDepartmentResult']"/>
</add-association>
</xsl:variable>
<xsl:variable name="results" select="cmd:execute($srcCommandProcessor, $add-association)"/>
</xsl:if>

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


I have the following namespaces and parameters in my document at the
top:


Code:
--------------------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
exclude-result-prefixes="query cmd dncv"
version="1.0"
xmlns:cmd="">www.novell.com/.../com.novell.nds.dirxml.driver.XdsCommandProcessor"
xmlns:dncv="">www.novell.com/.../com.novell.nds.dirxml.driver.DNConverter"
xmlns:query="">www.novell.com/.../com.novell.nds.dirxml.driver.XdsQueryProcessor"
xmlns:xsl="">www.w3.org/.../Transform">
<!-- parameters passed in from the DirXML engine -->
<xsl:param name="srcQueryProcessor"/>
<xsl:param name="destQueryProcessor"/>
<xsl:param name="srcCommandProcessor"/>
<xsl:param name="destCommandProcessor"/>
<xsl:param name="dnConverter"/>
<xsl:param name="fromNds"/>

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


The trace:


Code:
--------------------

<nds dtdversion="2.0">
<source>
<product build="20141121_0927" instance="soapIntra01" version="4.0.0.3">Identity Manager Driver for SOAP
</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<s:Envelope xmlns:s="">schemas.xmlsoap.org/.../">
<s:Body>
<AddDepartmentResponse xmlns="">http://tempuri.org/">
<AddDepartmentResult>true</AddDepartmentResult>
</AddDepartmentResponse>
</s:Body>
</s:Envelope>
</output>
<operation-data event-id="1" url="">test.customer.dk/.../DepartmentService.svc" xm
lns:soap="">www.w3.org/.../>
<operation-data event-id="2" soap-action="">tempuri.org/.../AddDepartment" xmlns:soap=
"">www.w3.org/.../>
</nds>
[08/27/15 18:06:22.540]:soapIntra01 ST: Cxsl:message -> Add Department - true
[08/27/15 18:06:22.540]:soapIntra01 ST: Cxsl:message -> AddAssociation DN: \IDVTREE\top\idv\structures\d
epartments\23395C1857F14792B6501F0BAF6FFFD2
[08/27/15 18:06:22.541]:soapIntra01 ST: Cxsl:message -> AddAssociation src-entry-id: 48679
[08/27/15 18:06:22.541]:soapIntra01 ST: Cxsl:message -> AddAssociation DeptID: 23395C1857F14792B6501F0BA
F6FFFD2
[08/27/15 18:06:22.542]:soapIntra01 ST: Direct command from policy
[08/27/15 18:06:22.543]:soapIntra01 ST:
<nds dtdversion="4.0" ndsversion="8.x">
<input>
<add-association dest-dn="\IDVTREE\top\idv\structures\departments\23395C1857F14792B6501F0BAF6FFFD2" even
t-id="0" src-entry-id="48679" xmlns:soap="">www.w3.org/.../add-association>
</input>
</nds>
[08/27/15 18:06:22.545]:soapIntra01 ST: Pumping XDS to eDirectory.
[08/27/15 18:06:22.545]:soapIntra01 ST:
DirXML Log Event -------------------
Driver: \IDVTREE\top\system\IDMDriverSet01\soapIntra01
Channel: Subscriber
Object: \IDVTREE\top\idv\structures\departments\23395C1857F14792B6501F0BAF6FFFD2
Status: Error
Message: Code(-9061) Error processing XSLT policy: vnd.nds.stream://IDVTREE/top/system/IDMDriverSet01/
soapIntra01/Subscriber/itq-sub-output#XmlData (117): <xsl:variable>: expression evaluation error: function c
all to 'cmd:execute' resulted in an error: 'java.lang.NullPointerException'
[08/27/15 18:06:22.557]:soapIntra01 ST:Processing returned document.
[08/27/15 18:06:22.558]:soapIntra01 ST:Processing operation <status> for .
[08/27/15 18:06:22.558]:soapIntra01 ST:
DirXML Log Event -------------------
Driver: \IDVTREE\top\system\IDMDriverSet01\soapIntra01
Channel: Subscriber
Object: \IDVTREE\top\idv\structures\departments\23395C1857F14792B6501F0BAF6FFFD2
Status: Error
Message: Code(-9037) One or more errors occurred while processing an XSLT policy.
[08/27/15 18:06:22.568]:soapIntra01 ST:End transaction.

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


So it looks like the data for the assicoation attribute is okay, but for
some reason I get a "java.lang.NullPointerException".

This is an IDM 4.5.1 system. In production this driver works, and the
association add works aswell. So, I might think that the upgrade has
broken this functionality. I don't know how though.

Driver is version 4.0.0.3.

Any ideas?

thanks in advance,

Jacob.


--
jacmarpet
------------------------------------------------------------------------
jacmarpet's Profile: https://forums.netiq.com/member.php?userid=415
View this thread: https://forums.netiq.com/showthread.php?t=54150

Parents
  • On Thu, 27 Aug 2015 16:44:01 0000, jacmarpet wrote:

    > <xsl:variable name="add-association">
    > <add-association>
    > <xsl:attribute name="dest-

    dn">
    > <xsl:value-of

    select="$lDN"/>
    > </xsl:attribute>
    > <xsl:attribute

    name="event-id">0</xsl:attribute> <xsl:attribute
    > name="src-entry-id">
    > <xsl:value-of

    select="$lSrcEntryID"/>
    > </xsl:attribute>
    > <xsl:value-of
    > select="$result//*[local-

    name()='AddDepartmentResult']"/>
    > </add-association>
    > </xsl:variable>


    I think this is your problem. Take out the <xsl:variable> here. You just
    want the XSLT to output the <add-association> in the XDS. I have
    something similar here, like:


    <xsl:if test="$association and $dn and $code = 'SUCCESS'">
    <add-association>
    <xsl:attribute name="dest-dn">
    <xsl:value-of select="$dn"/>
    </xsl:attribute>
    <xsl:attribute name="event-id">
    <xsl:value-of select="$eventID"/>
    </xsl:attribute>
    <xsl:attribute name="dest-entry-id">
    <xsl:value-of select="$entryID"/>
    </xsl:attribute>
    <xsl:value-of select="$association"/>
    </add-association>
    </xsl:if>


    where the association value is calculated elsewhere in the XSLT.


    --
    --------------------------------------------------------------------------
    David Gersic dgersic_@_niu.edu
    Knowledge Partner http://forums.microfocus.com

    Please post questions in the forums. No support provided via email.
    If you find this post helpful, please click on the star below.

  • dgersic;260307 Wrote:
    > On Thu, 27 Aug 2015 16:44:01 0000, jacmarpet wrote:
    >
    > > <xsl:variable name="add-association">
    > > <add-association>
    > > <xsl:attribute name="dest-

    > dn">
    > > <xsl:value-of

    > select="$lDN"/>
    > > </xsl:attribute>
    > > <xsl:attribute

    > name="event-id">0</xsl:attribute> <xsl:attribute
    > > name="src-entry-id">
    > > <xsl:value-of

    > select="$lSrcEntryID"/>
    > > </xsl:attribute>
    > > <xsl:value-of
    > > select="$result//*[local-

    > name()='AddDepartmentResult']"/>
    > > </add-association>
    > > </xsl:variable>

    >
    > I think this is your problem. Take out the <xsl:variable> here. You
    > just
    > want the XSLT to output the <add-association> in the XDS. I have
    > something similar here, like:
    >
    > >

    Code:
    --------------------
    > >

    > <xsl:if test="$association and $dn and $code = 'SUCCESS'">
    > <add-association>
    > <xsl:attribute name="dest-dn">
    > <xsl:value-of select="$dn"/>
    > </xsl:attribute>
    > <xsl:attribute name="event-id">
    > <xsl:value-of select="$eventID"/>
    > </xsl:attribute>
    > <xsl:attribute name="dest-entry-id">
    > <xsl:value-of select="$entryID"/>
    > </xsl:attribute>
    > <xsl:value-of select="$association"/>
    > </add-association>
    > </xsl:if>
    >

    --------------------
    > >

    >
    > where the association value is calculated elsewhere in the XSLT.
    >
    >
    > --
    > --------------------------------------------------------------------------
    > David Gersic
    > dgersic_@_niu.edu
    > Knowledge Partner
    > http://forums.microfocus.com
    >
    > Please post questions in the forums. No support provided via
    > email.
    > If you find this post helpful, please click on the star below.


    Hmm. But, if I do that, no actual NDS document is generated. If I change
    my code from:


    Code:
    --------------------

    <xsl:if test="$result//*[local-name()='AddDepartmentResult'] = 'true'">
    <xsl:message>AddAssociation DeptID: <xsl:value-of select="$lDeptID"/>
    <xsl:message>AddAssociation DN: <xsl:value-of select="$lDN"/></xsl:message>
    <xsl:message>AddAssociation src-entry-id: <xsl:value-of select="$lSrcEntryID"/></xsl:message>
    </xsl:message>
    <xsl:variable name="add-association">
    <add-association>
    <xsl:attribute name="dest-dn">
    <xsl:value-of select="$lDN"/>
    </xsl:attribute>
    <xsl:attribute name="event-id">0</xsl:attribute>
    <xsl:attribute name="src-entry-id">
    <xsl:value-of select="$lSrcEntryID"/>
    </xsl:attribute>
    <xsl:value-of select="$lDeptID"/>
    </add-association>
    </xsl:variable>
    <xsl:message>Event: <xsl:value-of select="$add-association"/></xsl:message>
    <xsl:variable name="results" select="cmd:execute($srcCommandProcessor, $add-association)"/>
    </xsl:if>

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


    to:


    Code:
    --------------------

    <xsl:if test="$result//*[local-name()='AddDepartmentResult'] = 'true'">
    <xsl:message>AddAssociation DeptID: <xsl:value-of select="$lDeptID"/>
    <xsl:message>AddAssociation DN: <xsl:value-of select="$lDN"/></xsl:message>
    <xsl:message>AddAssociation src-entry-id: <xsl:value-of select="$lSrcEntryID"/></xsl:message>
    </xsl:message>
    <add-association>
    <xsl:attribute name="dest-dn">
    <xsl:value-of select="$lDN"/>
    </xsl:attribute>
    <xsl:attribute name="event-id">0</xsl:attribute>
    <xsl:attribute name="src-entry-id">
    <xsl:value-of select="$lSrcEntryID"/>
    </xsl:attribute>
    <xsl:value-of select="$lDeptID"/>
    </add-association>
    </xsl:if>

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


    That results in a document that looks like:


    Code:
    --------------------

    <add-association dest-dn="\IDVTREE\top\idv\structures\departments\006F67370CD44C968555C8D985802FF3" even
    t-id="0" src-entry-id="48681" xmlns:soap="">www.w3.org/.../soap-envelope">006F67370CD44C968555C8D98
    5802FF3</add-association>

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


    instead of:


    Code:
    --------------------

    <nds dtdversion="4.0" ndsversion="8.x">
    <input>
    <add-association dest-dn="\IDVTREE\top\idv\structures\departments\006F67370CD44C968555C8D985802FF3" even
    t-id="0" src-entry-id="48681" xmlns:soap="">www.w3.org/.../soap-envelope">006F67370CD44C968555C8D98
    5802FF3</add-association>
    </input>
    </nds>

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


    I might misunderstand you though.


    --
    jacmarpet
    ------------------------------------------------------------------------
    jacmarpet's Profile: https://forums.netiq.com/member.php?userid=415
    View this thread: https://forums.netiq.com/showthread.php?t=54150


  • Okay, so now it works. I changed the value of the actual association to
    not just set the value to true. It is correct that it is not the correct
    thing to write. I instead write the CN of the object, which is a GUID.

    I the changed the stylesheet header to also exclude soap-env. That made
    no difference. Then i tried doing what you suggested Alex, with
    stripping the SOAP header, but without luck.

    Just for fun, I thought that maybe the src-entry-id or the event-id
    might be a problem. Removing the src-entry-id from the event removes the
    null pointer exception. So my code is now:


    Code:
    --------------------

    <xsl:if test="$result//*[local-name()='AddDepartmentResult'] = 'true'">
    <xsl:message>AddAssociation DeptID: <xsl:value-of select="$lDeptID"/>
    <xsl:message>AddAssociation DN: <xsl:value-of select="$lDN"/></xsl:message>
    <xsl:message>AddAssociation src-entry-id: <xsl:value-of select="$lSrcEntryID"/></xsl:message>
    </xsl:message>
    <xsl:variable name="add-association">
    <add-association>
    <xsl:attribute name="dest-dn">
    <xsl:value-of select="$lDN"/>
    </xsl:attribute>
    <xsl:attribute name="event-id">0</xsl:attribute>
    <!--
    <xsl:attribute name="src-entry-id">
    <xsl:value-of select="$lSrcEntryID"/>
    </xsl:attribute>
    -->
    <xsl:value-of select="$lDeptID"/>
    </add-association>
    </xsl:variable>
    <xsl:variable name="results" select="cmd:execute($srcCommandProcessor, $add-association)"/>
    </xsl:if>

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


    I do not understand why removing that actually works. I would have
    thought it was mandatory to have that in the document header.

    The trace:


    Code:
    --------------------

    [08/28/15 16:59:23.089]:soapIntra01 ST:
    <nds dtdversion="4.0" ndsversion="8.x">
    <input>
    <add-association dest-dn="\IDVTREE\top\idv\structures\departments\006F67370CD44C968555C8D985802FE0" even
    t-id="0" xmlns:soap="">www.w3.org/.../add-associat
    ion>
    </input>
    </nds>
    [08/28/15 16:59:23.091]:soapIntra01 ST: Pumping XDS to eDirectory.
    [08/28/15 16:59:23.092]:soapIntra01 ST: Performing operation add-association for \IDVTREE\top\idv\structure
    s\departments\006F67370CD44C968555C8D985802FE0.
    [08/28/15 16:59:23.118]:soapIntra01 ST: Processing returned document.
    [08/28/15 16:59:23.119]:soapIntra01 ST: Processing operation <status> for .
    [08/28/15 16:59:23.120]:soapIntra01 ST:
    DirXML Log Event -------------------
    Driver: \IDVTREE\top\system\IDMDriverSet01\soapIntra01
    Channel: Subscriber
    Object: \IDVTREE\top\idv\structures\departments\006F67370CD44C968555C8D985802FE0
    Status: Success

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


    Any idea what might be wrong with the way I set the src-entry-id?

    Full stylesheet:

    http://dumptext.com/lLmOLrmn

    Jacob.


    --
    jacmarpet
    ------------------------------------------------------------------------
    jacmarpet's Profile: https://forums.netiq.com/member.php?userid=415
    View this thread: https://forums.netiq.com/showthread.php?t=54150

  • jacmarpet wrote:

    >
    > Okay, so now it works. I changed the value of the actual association to
    > not just set the value to true. It is correct that it is not the correct
    > thing to write. I instead write the CN of the object, which is a GUID.
    >
    > I the changed the stylesheet header to also exclude soap-env. That made
    > no difference. Then i tried doing what you suggested Alex, with
    > stripping the SOAP header, but without luck.


    Looking moreclosely, I think the specific header value needs to be s not soap-env

    > Just for fun, I thought that maybe the src-entry-id or the event-id
    > might be a problem. Removing the src-entry-id from the event removes the
    > null pointer exception. So my code is now:


    .....
    >
    >
    > Any idea what might be wrong with the way I set the src-entry-id?
    >



    If you look at what is documented as allowed in an add-association, it shows you need to use dest-entry-id and set it to the src-entry-id of the <add>
    So likely they are now more strictly enforcing invalid attributes in 4.5

    > Full stylesheet:
    >
    > http://dumptext.com/lLmOLrmn
    >


    I have some more comments about the stylesheet - may reply a bit later with some feedback.
Reply
  • jacmarpet wrote:

    >
    > Okay, so now it works. I changed the value of the actual association to
    > not just set the value to true. It is correct that it is not the correct
    > thing to write. I instead write the CN of the object, which is a GUID.
    >
    > I the changed the stylesheet header to also exclude soap-env. That made
    > no difference. Then i tried doing what you suggested Alex, with
    > stripping the SOAP header, but without luck.


    Looking moreclosely, I think the specific header value needs to be s not soap-env

    > Just for fun, I thought that maybe the src-entry-id or the event-id
    > might be a problem. Removing the src-entry-id from the event removes the
    > null pointer exception. So my code is now:


    .....
    >
    >
    > Any idea what might be wrong with the way I set the src-entry-id?
    >



    If you look at what is documented as allowed in an add-association, it shows you need to use dest-entry-id and set it to the src-entry-id of the <add>
    So likely they are now more strictly enforcing invalid attributes in 4.5

    > Full stylesheet:
    >
    > http://dumptext.com/lLmOLrmn
    >


    I have some more comments about the stylesheet - may reply a bit later with some feedback.
Children
No Data