Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 5 Transport Communication : Non-Standard JMS Headers

Non-Standard JMS Headers
You can set the JMS properties using the non-standard header fields in the request message. The HTTP header fields such as Host, Content-Type, Content-Length of the request message can be set as the JMS properties. TIBCO API Exchange Gateway forwards the request message containing the JMS properties to the target operation. The header fields can be set using a transformation (XSLT) file.
Setup JMS Properties
Set up the JMS properties using the following steps:
1.
2.
Copy the XSLT file to the ASG_CONFIG_HOME/ASG_Project/xslt/internal directory.
3.
4.
a.
b.
Click the MAPPING > Mapping tab.
c.
Click the Add Property icon to create a new mapping.
d.
Under New Mapping, add the parameters as follows:
Mapping Name: Enter a name for the mapping.
Type: select XLST from the drop-down list.
Existing Files: select the newly created XLST file from the drop-down list.
e.
Click the Save icon to save the changes.
5.
a.
Click the ROUTING tab.
b.
Click the Facade Operations tab.
c.
d.
Click on Request Transform field. Select the newly added mapping from the drop-down list.
6.
Click the Save icon to save the changes.
 
Example XSLT
Refer to the following XSLT:

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:map="http://www.tibco.com/asg/mapping"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:form="http://www.tibco.com/asg/functions/form"
xmlns:c="http://www.tibco.com/schemas/asg/context"
xmlns:h="http://www.tibco.com/asg/protocols/http"
xmlns:k="http://www.tibco.com/asg/protocols/jms"
xmlns:f="http://www.tibco.com/asg/content-types/form"
xmlns:codecs="http://www.tibco.com/asg/functions/codecs"
exclude-result-prefixes="xsl soap11 c h form codecs"
>
 
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
 
<xsl:variable name="cnRequestHref">
<xsl:value-of select="/transformation/cnRequest/@href"/>
</xsl:variable>
 
<xsl:variable name="context">
<c:context>
<xsl:for-each select="/transformation/context">
<xsl:copy-of select="document(@href)/c:context/*"/>
</xsl:for-each>
</c:context>
</xsl:variable>
<xsl:variable name="recdRequest">
<xsl:copy-of select="$context/c:context/c:entry[@key='asg:jmsRequest']/k:request"/>
</xsl:variable>
 
<xsl:variable name="reqBody">
<xsl:choose xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:when test="count(document($cnRequestHref)/soap:Envelope/soap:Body)=1">
<xsl:copy-of select="document($cnRequestHref)"/>
</xsl:when>
<xsl:otherwise>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
</soapenv:Header>
<soapenv:Body>
<xsl:copy-of select="document($cnRequestHref)"/>
</soapenv:Body>
</soapenv:Envelope>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
 
<xsl:template match="/">
<map:mapping-result>
<map:failOnError>false</map:failOnError>
<map:context>
<c:context>
<c:entry key="asg:jmsRequest">
<k:override-header name="httpheadertest">identity</k:override-header>
</c:entry>
</c:context>
</map:context>
<map:payload-xml>
<xsl:copy-of select="$reqBody"/>
</map:payload-xml>
</map:mapping-result>
</xsl:template>
</xsl:stylesheet>

 
 

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved