Setting up JMS Properties

Set up the JMS properties using the following steps:

Procedure

  1. Create an XSLT File. Refer to Example XSLT.
  2. Copy the XSLT file to the ASG_CONFIG_HOME/ASG_Project/xslt/internal directory.
  3. Start the Config UI.
  4. Create a new mapping as follows:
    1. Select the gateway configuration project.
    2. Click the MAPPING > Mapping tab.
    3. Click the Add Property icon to create a new mapping.
    4. 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.
    5. Click the Save icon to save the changes.
  5. Upload the XSLT file for the facade operation as follows:
    1. Click the ROUTING tab.
    2. Click the Facade Operations tab.
    3. Select the facade operation for which the headers are to be set.
    4. 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>