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 Reply Children

  • A note to add:

    This code works in production but not in test. The environment has been
    upgraded in test and now this does not work. Here is a trace from
    production where it works:


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

    <nds dtdversion="4.0" ndsversion="8.x">
    <input>
    <add-association dest-dn="\IDVTREE\top\idv\entities\users\dg4841" event-id="0" src-entry-id="46941" xmlns:soap="">www.w3.org/.../add-association>
    </input>
    </nds>

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


    and in test where it doesn't and I get the null pointer:


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

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

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


    Did something change in IDM 4.5 maybe?


    --
    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:

    >
    > I suspect the xmlns:soap="www.w3.org/.../soap-envelope in the
    > association event for being the problem. I wonder why that is added.


    Hard to answer without seeing the entire stylesheet.

    Definitely the soap-envelope part is problematic. you need to change

    exclude-result-prefixes="query cmd dncv"

    to
    exclude-result-prefixes="query cmd dncv soap"

    Also, note your add-association does not have a corresponding status event (with same event id). It really should.



    As a general comment, I usually approach this by using two stylesheets in the input transform.

    First a generic stylesheet that just strips the soap envelope wrapper. (this is identical to the one distributed with the NetIQ SPML 2.0 package)

    <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet exclude-result-prefixes="query cmd dncv soap-env" 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:soap-env="">schemas.xmlsoap.org/.../" xmlns:xsl="">www.w3.org/.../Transform">
    <!-- parameters passed in from the Identity Manager 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"/>
    <!-- This is for testing the stylesheet outside of Identity Manager so things are pretty to look at -->
    <xsl:strip-space elements="*"/>
    <xsl:preserve-space elements="value,component"/>
    <xsl:output indent="yes" method="xml"/>
    <!-- *********************** -->
    <!-- Strip off SOAP header -->
    <!-- *********************** -->
    <xsl:template match="soap-env:Envelope">
    <!-- ignore this element but process all children -->
    <xsl:apply-templates select="soap-env:Body/*"/>
    <xsl:apply-templates select="operation-data"/>
    </xsl:template>
    <xsl:template match="soap-env:Fault">
    <status level="error">
    <xsl:if test="../operation-data/@event-id">
    <xsl:attribute name="event-id">
    <xsl:value-of select="../operation-data/@event-id"/>
    </xsl:attribute>
    </xsl:if>
    <xsl:apply-templates select="node()"/>
    </status>
    </xsl:template>
    <!-- identity transformation template -->
    <!-- in the absence of any other templates this will cause -->
    <!-- the stylesheet to copy the input through unchanged to the output -->
    <xsl:template match="node()|@*">
    <xsl:copy>
    <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
    </xsl:template>
    </xsl:stylesheet>


    Then a second stylesheet that transforms the response and generates a status either instance or add association depending on the request.

    I find that approach cleaner.
  • jacmarpet <jacmarpet@no-mx.forums.microfocus.com> wrote:


    > Did something change in IDM 4.5 maybe?
    >


    Lots of association code got touched in 4.5 because they added a new
    (optional) way to handle associations.

    It is definitely possible.

    Also, why is your association value set to 'true'? That seems problematic
    and likely non-unique

    --
    If you find this post helpful and are logged into the web interface, show
    your appreciation and click on the star below...
  • jacmarpet <jacmarpet@no-mx.forums.microfocus.com> wrote:


    > Did something change in IDM 4.5 maybe?
    >


    Lots of association code got touched in 4.5 because they added a new
    (optional) way to handle associations.

    It is definitely possible.

    Also, why is your association value set to 'true'? That seems problematic
    and likely non-unique

    --
    If you find this post helpful and are logged into the web interface, show
    your appreciation and click on the star below...