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


Chapter 7 Transaction Pipeline Processing : Pass-Through Gateway

Pass-Through Gateway
TIBCO API Exchange Gateway acts as a pass-through gateway for the REST, SOAP/HTTP, SOAP/JMS, and ESB facade operation requests which contains the URI or SOAPAction that do not match the operation URI or SOAP Action of the facade operation configured in the gateway.
TIBCO API Exchange Gateway supports the pass-though functionality using the DefaultOperation facade operation. You must configure a DefaultOperation facade operation for your project using the Config UI. See Configure DefaultOperation Facade Operation.
To enable the TIBCO API Exchange Gateway as a pass-through gateway, complete these tasks:
 
Task A Start Config UI
1.
2.
Task B Enable Default Operation
Enable the DefaultOperation feature as follows:
1.
Select the Gateway Engine Properties from the drop-down list.
2.
Click the General link.
3.
Expand the Common node.
4.
Select the Enable Default Operation field.
To set the runtime property in the asg.properties file, follow these steps:
1.
Navigate to the ASG_CONIG_HOME directory.
2.
Edit the asg.properties file in a text editor.
3.
   tibco.clientVar.ASG/Operation/EnableDefaultOperation=true
4.
Task C Configure DefaultOperation Facade Operation
By default, TIBCO API Exchange Gateway provides the DefaultOperation facade operation for the example projects shipped with the product. For example, BookQuery project has a DefaultOperation operation configured under ROUTING > Facade Operations.
To use the DefaultOperation feature for your project, configure a facade operation as follows:
For the REST requests, configure a DefaultOperation facade operation as
follows:
1.
Click the PARTNER > Facade Operations tab.
2.
Click the Add Property icon.
3.
Enter DefaultOperation as the name of the facade operation.
For example, /asg/defaultOperation
4.
1.
Click the PARTNER > Facade Operations tab.
2.
Click the Add Property icon.
3.
Enter DefaultOperation as the name of the facade operation.
For example, /asg/defaultOperation
For example, "/GetDefaultOperation"
4.
Task D Configure Target Operation for DefaultOperation
Configure a target operation (if not existing), where the DefaultOperation facade operation request is routed.
For example, configure a HTTP type target operation for the DefaultOperation facade operation as follows:
1.
Click the ROUTING > Target Operations tab.
2.
Click the Add Property icon.
3.
For example, http.DefaultTargetOperation
For example, /asg/test
4.
Task E Configure Routing Key for DefaultOperation
Configue a routing key for the DefaultOperation as follows:
1.
Click the ROUTING > Routing tab.
2.
Click the Add Property icon.
3.
Select DefaultOperation from the drop-down list.
Select Target Operation from the drop-down list.
Select http.DefaultTargetOperation from the drop-down list.
4.
Task F Configure Facade Access for DefaultOperation
Configure the partner for DefaultOperation as follows:
1.
Click the PARTNER > Facade Access tab.
2.
Click the Add Property icon.
3.
Add the anon partner to access the DefaultOperation as follows:
Select anon from the drop-down list.
Select DefaultOperation from the drop-down list.
4.
Override HTTP Headers
To overwrite the host, port, and URI and any other header fields, enable the southbound forward mapping for a target operation, as follows:
1.
Create the XSLT file, such as pass-through.xsl. Refer to the Sample XSLT File to override the fields in the request message.
2.
Copy the XSLT file (pass-through.xsl) to the ASG_CONFIG_HOME/ASG_Project/xslt directory.
3.
Click on MAPPING > Mapping tab.
4.
Click the Add Property icon.
5.
Select XSLT from the drop-down list.
Select the XSLT file (pass-through.xsl) from the drop-down list, if the XSLT is located in the ASG_CONFIG_HOME/ASG_Project/xslt directory.
Select Full from the drop-down list.
6.
7.
Click the PARTNER > Target Operations tab.
8.
Click the Add Property icon.
9.
Select the mapping, such as pass-through-map in the Request Transform field.
10.
Sample XSLT File
The following is an example XSLT to override the host, port, and URI :

 
<?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: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:httpRequest']/h:request"/>
</xsl:variable>
 
<xsl:template match="/">
<map:mapping-result>
<map:context>
<c:context>
<xsl:for-each select="$recdRequest/h:request/h:header">
<xsl:variable name="hdr_name" select="@name"/>
<xsl:if test="lower-case($hdr_name)!='accept-encoding'">
<xsl:element name="h:override-header">
<xsl:attribute name="name"><xsl:value-of select="$hdr_name"/></xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
</xsl:if>
</xsl:for-each>
<h:override-header name="Accept-Encoding">identity</h:override-header>
<xsl:choose>
<xsl:when test="string-length($recdRequest/h:request/h:query-string)>0">
<h:override-URI><xsl:value-of select="concat($recdRequest/h:request/h:request-uri,'?',$recdRequest/h:request/h:query-string)"/></h:override-URI>
</xsl:when>
<xsl:otherwise>
<h:override-URI><xsl:value-of select="$recdRequest/h:request/h:request-uri"/></h:override-URI>
</xsl:otherwise>
</xsl:choose>
<h:override-method><xsl:value-of select="$recdRequest/h:request/h:method"/></h:override-method>
</c:context>
</map:context>
<map:payload-xml><root><xsl:value-of select="$recdRequest/h:request/h:body"/></root></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