• Add a Comment
  • Edit
  • More Actions v
  • Quarantine this Entry

Comments (7)

1 HermannSW commented Permalink

Wow — <dp:reject></dp:reject> and var://service/error-protocol-response do work, too:

2 HermannSW commented Permalink

Wow — <dp:reject></dp:reject> and var://service/error-protocol-response do work, too:

 


(see "... response code: 444 ..." in Console)

3 HermannSW commented Permalink

Hmm -- how do I get this comment posted?


Wow, dp:reject and var://service/error-protocol do work:

 


 :
(see "... response code: 444 ..." in Console)


 
Hermann.
 

4 rkiesi commented Permalink

Hi Hermann,
good startiung point! But why not adding a bit more details on the execution of a stylesheet to the output - at least in case of an error. On can simple use an error rule with a stylesheet like the following to give an idea of the error on the box without the need to look at the DP logs itself.
The very best would be to collect all log messages with level 'detail' for the given transaction and post it as reply in case of an error. I'm not sure if that is feasible..

 
Sample for more speaking error reply stylesheet (used in several customer situations):
 
 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dp="http://www.datapower.com/extensions" xmlns:dpfunc="http://www.datapower.com/extensions/functions" xmlns:dpconfig="http://www.datapower.com/param/config" xmlns:func="http://exslt.org/functions" xmlns:date="http://exslt.org/dates-and-times" xmlns:regexp="http://exslt.org/regular-expressions" xmlns:str="http://exslt.org/strings" extension-element-prefixes="dp func dpconfig" exclude-result-prefixes="dp dpfunc dpconfig func date str regexp">
 
<xsl:output method="xml" version="1.0" encoding="UTF-8"></xsl:output>
 
<xsl:template match="/">
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<env:Fault>
<faultcode>DP:<xsl:value-of select="dp:variable('var://service/error-code')"></xsl:value-of></faultcode>
<faultstring>Rejected.</faultstring>
<datapower-details>
<service><xsl:value-of select="dp:variable('var://service/processor-name')"></xsl:value-of></service>
<transaction><xsl:value-of select="dp:variable('var://service/transaction-id')"></xsl:value-of></transaction>
<operation><xsl:value-of select="dp:variable('var://service/URI')"></xsl:value-of></operation>
<xsl:element name="result">
<xsl:choose>
<xsl:when test="dp:variable('var://service/error-code') = '0x00000000'">
<xsl:attribute name="status">OK</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="status">ERROR</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<!--
<xsl:value-of select="dp:variable('var://service/error-code')"/>
<subcode><xsl:value-of select="dp:variable('var://service/error-subcode')"/></subcode>
-->
<message><xsl:value-of select="dp:variable('var://service/error-message')"></xsl:value-of></message>
</xsl:element>
</datapower-details>
 
</env:Fault>
</env:Body>
</env:Envelope>
</xsl:template>
 
</xsl:stylesheet>

5 rkiesi commented Permalink

Hi Hermann,
good startiung point! But why not adding a bit more details on the execution of a stylesheet to the output - at least in case of an error. On can simple use an error rule with a stylesheet like the following to give an idea of the error on the box without the need to look at the DP logs itself.
The very best would be to collect all log messages with level 'detail' for the given transaction and post it as reply in case of an error. I'm not sure if that is feasible..

 

6 BrijeshKadecha commented Permalink

Hi Hermann,

 
One question - if my xsl includes other xsl as library then how do I pass 2 xsl's to datapower?
I am getting below error while coprocessing my xml -
 
xmlmgr (default): xslt: Request failed to compile. Error opening URL 'xa35://tmp/nclAmadeusLib.xsl' This is referenced by xa35://tmp/temp_00237.
 
nclAmadeusLib.xsl being the library xsl that my stylesheet depends on.
 
Thanks

7 HermannSW commented Permalink

Hi Brijesh,

 
please see posting boot.xsl allows includes/imports for coproc2 service for a possible solution.
 
Hermann.

Add a Comment Add a Comment