I have an XSL policy which receives an incoming SOAP request and adds a tag into the SOAP Header. I am specifying a specific variable to accept the end product of the XSL transformation. However, That variable shows as empty int he trace logs when I consume it using an Assign Message (or Extract policy)
The XSL adds a sessionId to the incoming request.
XSL -
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <xsl:output method="xml" version="1.0" encoding="UTF-8" /> <xsl:param name="sessionId"/> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="soapenv:Header"> <xsl:copy> <urn:sessionId> <xsl:value-of select="$sessionId"/> </urn:sessionId> </xsl:copy> </xsl:template> </xsl:stylesheet>
XSL Policy -
<XSL name="XSLTransform"> <DisplayName>XSLTransform</DisplayName> <Source>request</Source> <ResourceURL>xsl://AddSessionId.xslt</ResourceURL> <Parameters> <Parameter name="sessionId" ref="sessionId"/> </Parameters> <OutputVariable>IncomingRequest</OutputVariable> </XSL>
'IncomingRequest' is being consumed by an Assign Message policy - but the trace does not show this variable having any value. IncomingRequest.content is also empty.
Why is this happening?
Solved! Go to Solution.
Hi @hari.vr-ext,
When you trace the XSL policy, do you see the IncomingRequest variable being set? In the Variables Assigned section of the trace, if you see IncomingRequest shown with an equals sign, then the value is being set, but maybe it is being set to an empty string. OutputVariable should be a string variable, not a message variable, so IncomingRequest.content would never have a value.
I tried an XSL policy on my system with OutputVariable and it worked. Maybe your XSL isn't generating any output for your input somehow? If you create a simpler XSL, does it work?
<XSL name="xslTest"> <ResourceURL>xsl://TestScript.xslt</ResourceURL> <OutputVariable>testXslVar</OutputVariable> </XSL> <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"><root/></xsl:template> </xsl:stylesheet>