Has anyone has an example on the gateway script for the
dp:invalidate-cached-documents() function?
I tried in xslt and it is not working. Any suggestions are greatly appreciated. I have to invalidate the cache entry if one of the api matches and I dont see the document id is getting removed when I look at the document status in DataPower. Here is my xslt.
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dp="http://www.datapower.com/extensions"
xmlns:dpconfig="http://www.datapower.com/param/config" extension-element-prefixes="dp" exclude-result-prefixes="dp dpconfig">
<xsl:variable name="dpDomainName" select="dp:variable('var://service/domain-name')"/>
<xsl:variable name="dpXMLManagerName" select="dp:variable('var://service/xmlmgr-name')"/>
<xsl:variable name="dpURI" select="dp:variable('var://service/URI')"/>
<xsl:variable name="securityToken">
<xsl:value-of select="dp:http-request-header('securityToken')"/> <!-- 94500D8B17E64A38A21B128C336C2BD0-->
</xsl:variable>
<xsl:variable name="dpCachePattern">
<xsl:value-of select="'*'"/>
</xsl:variable>
<xsl:param name="dpconfig:sessionEndpoint" select="'http://DEVF1_localhost:9008'"/>
<xsl:template match="/">
<xsl:variable name="CallEndPoint" select="normalize-space($dpconfig:sessionEndpoint)"/>
<xsl:variable name="AuthEndPoint" select="concat($CallEndPoint,'/CWValidateAuthToken?',$securityToken)"/>
<xsl:choose>
<xsl:when test="contains($dpURI,'/session/impersonate')">
<xsl:variable name="dpCacheValues" select="dp:invalidate-cached-documents($dpDomainName, $dpXMLManagerName, $AuthEndPoint, $dpCachePattern)"/>
<xsl:if test="$dpCacheValues > 0">
<xsl:message>Found entries and invalidated</xsl:message>
</xsl:if>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
------------------------------
Suresh Sanga
------------------------------