Hi Everyone,

I am using SOAP driver for provisioning the user to the target system.
The user is getting created on the target application but when executing
the <xsl:template match="spml:insertResponse">, the request is getting
failed because of the Status and //spmlsoID/@ID values. These 2 values
are getting as empty and the flow is going to the error state. Below is
the code that is executing.
<xsl:template match="spml:insertResponse">
<xsl:message>ITP Big 4</xsl:message>
<xsl:comment>ITP AddResponse <xsl:value-of
select="//return-to-me/@*"/></xsl:comment>
<xsl:variable name="dn" select="//return-to-me/@src-dn"/>
<xsl:variable name="eventID" select="//return-to-me/@event-id"/>
<xsl:variable name="entryID" select="//return-to-me/@src-entry-id"/>
<xsl:variable name="key" select="//spmlsoID/@ID"/>
<xsl:comment>ITP Insert Response # ID # <xsl:value-of
select="//spmlsoID/@ID"/></xsl:comment>
<xsl:variable name="code" select="@status"/>
<xsl:comment>ITP Insert Response # Status # <xsl:value-of
select="@status"/></xsl:comment>
<status>
<xsl:attribute name="event-id">
<xsl:value-of select="$eventID"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="$code = 'success'">
<xsl:attribute name="level">success</xsl:attribute>
<xsl:comment>ITP Insert Response # Level equals success #
</xsl:comment>
</xsl:when>
<xsltherwise>
<xsl:call-template name="return-error-handler"/>
<xsl:comment>ITP Insert Response # Level equals error #
</xsl:comment>
</xsltherwise>
</xsl:choose>
</status>
<xsl:if test="$key">
<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="$key"/>
</add-association>
</xsl:if>
</xsl:template>

The below is the log for the error details.
<nds dtdversion="2.0">
<source>
<product build="20121219_161345" instance="Service Now SPML Driver"
version="4.0.0.0">Identity Manager Driver for SOAP</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<!--ITP AddResponse 20140114103520.056Z-->
<!--ITP Insert Response # ID # -->
<!--ITP Insert Response # Status # -->
<status
event-id="USMINIQDEVIV01-NDS#20140114103519#1#1:b1017a19-c5e9-4825-b354-c1e590c9d31a"
level="error" type="app-general"
xmlns:spmlsearch="urnasis:names:tc:SPML:2:0:search">
<!--ITP Insert Response # Level equals error # -->
</status>
<!--ITP Small 1 - 2b8c198d9092950018b18680941852d2sys_usernameaaa88
aaa88inserted-->
<!--ITP Small 2 - -->
</output>
</nds>

Please find the below code that is executing in the Output
Transformation,
<xsl:template match="value" mode="to-dsml">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="add-attr[not(string(value)='')]" mode="to-dsml">
<xsl:element name="{@attr-name}">
<xsl:apply-templates mode="to-dsml" select="value[not(stri='')]"/>
</xsl:element>
</xsl:template>
<!-- convert XDS add to spml:addRequest -->
<xsl:template match="add">
<spml:insert executionMode="synchronous" requestID="{@event-id}"
returnData="identifier" xmlns:dsml="urnasis:names:tcSML:2:0:core"
xmlns:spml="urnasis:names:tc:SPML:2:0">
<xsl:apply-templates mode="to-dsml"
select="add-attr[not(@attr-name='Object Class')]"/>
<operation-data event-id="{@event-id}" parent-node-1="insertResponse"
xmlns="">
<!-- copy any data that may already exist on an operation data
element -->
<xsl:comment>setPSOID # </xsl:comment>
<xsl:apply-templates
select="operation-data/@*|operation-data/node()"/>
<xsl:comment>OTP 1 # </xsl:comment>
<return-to-me command="add">
<xsl:apply-templates select="@*"/>
</return-to-me>
</operation-data>
</spml:insert>
</xsl:template>
<!-- match output that has a status child that is the result of an
operation generated by a spml:batchRequest child -->
<xsl:template
match="output[status[operation-data/return-to-me/@batch-id]]">
<xsl:comment>Output batchResponse</xsl:comment>
<output>
<!-- wrap the SPML response elements in the appropriate batchResponse
parent -->
<spml:batchResponse
requestID="{status/operation-data/return-to-me/@batch-id[1]}"
xmlns:spml="urnasis:names:tc:SPML:2:0">
<xsl:attribute name="status">
<!-- if any status has other than success or warning, then batch
result is error -->
<xsl:choose>
<xsl:when test="status[not(@level='success' or
@level='warning')]">
<xsl:text>failure</xsl:text>
</xsl:when>
<xsltherwise>success</xsltherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="node()"/>
</spml:batchResponse>
</output>
</xsl:template>
<!-- strip instance elements that are the result of an SPML
searchRequest -->
<xsl:template
match="instance[operation-data/return-to-me/@request='query']"/>
<xsl:template
match="status[operation-data/return-to-me/@request='addRequest']">
<xsl:comment>Response 1 # Template</xsl:comment>
<!-- only build a response if we haven't already handled one for this
request -->
<xsl:variable name="response-id" select="concat('add',@event-id)"/>
<xsl:comment>Response 1 # Response ID Variable #
@event-id</xsl:comment>
<xsl:if test="not(set:contains($response-elements,$response-id))">
<xsl:variable name="dummy"
select="set:add($response-elements,$response-id)"/>
<spml:insertResponse xmlns:spml="urnasis:names:tc:SPML:2:0">
<xsl:comment>Response 2 # </xsl:comment>
<xsl:call-template name="set-response-data"/>
<spmlsoID>
<xsl:attribute name="ID">
<xsl:value-of select="operation-data/return-to-me/association"/>
</xsl:attribute>
<xsl:comment>Response Add # H ($ID)</xsl:comment>
</spmlsoID>
</spml:insertResponse>
</xsl:if>
</xsl:template>
<xsl:template match="instance" mode="search-response">
<xslaram name="status"/>
<spmlso>
<spmlsoId>
<xsl:attribute name="ID">
<xsl:choose>
<xsl:when test="not(string(association)='')">
<xsl:value-of select="association"/>
</xsl:when>
<xsltherwise>
<xsl:value-of select="@src-dn"/>
</xsltherwise>
</xsl:choose>
</xsl:attribute>
</spmlsoId>
<spml:data>
<xsl:apply-templates mode="to-dsml" select="attr"/>
</spml:data>
</spmlso>
</xsl:template>
<xsl:template name="set-response-data">
<!-- <xsl:message>Response Add set-response-data</xsl:message> -->
<!-- default context are all status elements that are siblings that
have the same event-id value -->
<xslaram name="context"
select="../status[string(@event-id)=string(current()/@event-id)]"/>
<xsl:call-template name="set-request-id">
<xsl:with-param name="context" select="$context"/>
</xsl:call-template>
<xsl:call-template name="set-result">
<xsl:with-param name="context" select="$context"/>
</xsl:call-template>
<xsl:call-template name="set-error-message">
<xsl:with-param name="context" select="$context"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="set-request-id">
<xslaram name="context"
select="../status[string(@event-id)=string(current()/@event-id)]"/>
<xsl:if test=" not(string($context[1]/@event-id)='') and
not(string($context[1]/@event-id)=string($context[1]/operation-data/return-to-me/@batch-id))
">
<xsl:attribute name="requestID">
<xsl:value-of select="$context[1]/@event-id"/>
</xsl:attribute>
</xsl:if>
</xsl:template>
<xsl:template name="set-result">
<xslaram name="context"
select="../status[string(@event-id)=string(current()/@event-id)]"/>
<xsl:attribute name="status">
<xsl:value-of select="''"/>
<xsl:choose>
<xsl:when test="not($context/@level) or not($context/@level !=
'success')">
<xsl:text>success</xsl:text>
</xsl:when>
<xsltherwise>
<xsl:text>failure</xsl:text>
</xsltherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:template match="text()" mode="set-error-message">
<xsl:if test="not(string(.) = '')">
<spml:errorMessage>
<xsl:value-of select="."/>
</spml:errorMessage>
</xsl:if>
</xsl:template>
<xsl:template name="set-error-message">
<!-- <xsl:message>Response Add set-error-message 2</xsl:message> -->
<xslaram name="context"
select="../status[string(@event-id)=string(current()/@event-id)]"/>
<xsl:if test="$context/@level != 'success' and $context/@level">
<xsl:apply-templates mode="set-error-message"
select="$context/text()"/>
</xsl:if>
</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>

Thanks in advance to everyone.

Best Regards,
Krish


--
krishnabkr
------------------------------------------------------------------------
krishnabkr's Profile: https://forums.netiq.com/member.php?userid=6459
View this thread: https://forums.netiq.com/showthread.php?t=49677