WebSphere Datapower Custom Error Stylesheet

<?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:dp="http://www.datapower.com/extensions"
        xmlns:dpconfig="http://www.datapower.com/param/config"
        xmlns:dpfunc="http://www.datapower.com/extensions/functions"
        exclude-result-prefixes="dp" 
        extension-element-prefixes="dp dpconfig dpfunc"
        version="1.0">    
      
 <xsl:template match="/">           
   <xsl:variable name="rejected">
     <env:Envelope 
            xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
       <env:Body>
         <env:Fault>
           <faultcode>env:Client</faultcode>
           <faultstring> 
               <xsl:element name="error_headers">
   <xsl:copy-of select="dp:variable('var://service/error-headers')"/>
               </xsl:element>
               <xsl:element name="error_message">
   <xsl:copy-of select="dp:variable('var://service/error-message')" />
               </xsl:element>                                             
               <xsl:element name="transaction_id">
   <xsl:value-of select="dp:variable('var://service/transaction-id')"/>
               </xsl:element>                                            
               <xsl:element name="error_code">
   <xsl:value-of select="dp:variable('var://service/error-code')"/>
               </xsl:element>	
               <xsl:element name="error_subcode">
<xsl:value-of select="dp:variable('var://service/error-subcode')"/>
               </xsl:element>
               <xsl:element name="formatted_error_msg">
<xsl:value-of select="dp:variable('var://service/formatted-error-message')"/>
               </xsl:element>
               <xsl:element name="error_protocol_reason_phrase">
<xsl:value-of select="dp:variable('var://service/error-protocol-reason-phrase')"/>
                </xsl:element>	                            
            </faultstring>
          </env:Fault>
       </env:Body>
     </env:Envelope>
   </xsl:variable>
   <xsl:copy-of select="$rejected"/>
  </xsl:template>
</xsl:stylesheet>
Advertisements

4 Comments on “WebSphere Datapower Custom Error Stylesheet

  1. Hi Micheal,

    I am trying to integrate Datapower with TAM, I tried my level best to configure with my knowledge
    but i have lot of questions like what to put in the feilds like “output configuration file” (in which format)…etc

    so can you please forward me a link or and guide which shows clearly about how to integrate Dp with Tam ( I mean in the config level).

    Thanks
    Looking forward for your email

  2. Hi,

    What type of authentication do you want to do using TAM?WS-Security/SAML?

    Send me your Datapower screenshots.

    Kind Regards,
    Thys Michels

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: