The intent of this blog is to showcase as to how the SAP PI based AXIS message protocol can be leveraged to conenct to the legacy applications via an enterprise messaging system like TIBCO EMS and a synchronous communication can be achieved from a JMS queue which is inherently asyncronous in nature.
The scenario describes a general Cashbalancing scenario which a SAP banking related process triggers to get end of day cash balancing from the core banking based legacy application via a synchronous call.
It’s basically a very normal synchronous scenario with a query/response pattern.
1. SAP Backend is doing a request through a synchronous interface.This request goes through the axis receiver channel and is delivered as a SOAP message to the JMS queue. The TIBCO EMS is making a synchronous call to the backend system and receives the response. The response message is put on the same queue (although a temporary dummy queue). We expect now this response message coming into the axis receiver channel on a separate JMS response queue into PI. Also before the message is delivered to the TIBCO based JMS queue ,it expects PI to add a custom message header to the message besides the standard header and while the response is coming back PI should again remove this header while passing it to the calling system.
Pl Please check the appropriate axis libraries are deployed to the PI server as shown below, without this AXIS related calls won’t be possible.
Th The requiredsda zip can be deployed through the SAP NWDS deployment as follows.
A Adding Custom SOAP headers in addition to standard header.
You can either write your own Axis handler that can insert an arbitrary SOAP header or use com.sap.aii.axis.soap.HeaderInsertionHandler to insert arbitrary SOAP headers. The com.sap.aii.axis.soap.HeaderInsertionHandler handler allows you to insert any number of non-nested or nested SOAP headers. See a sample receiver configuration for inserting the SOAP headers.
The first sample configuration inserts two SOAP headers: one with name abc with fixed value ABC, and the other with name url with value of parameter transport.url of the Axis’s message context. When parameters name.n and namespace.n are set, this handler inserts the specified header with the element value given in parameter value.n. The second sample inserts the ebXML header whose element values are retrieved from the XI DynamicConfiguration header (ASMA). When parameters name.n and namespace.n are absent, the value given in parameter value.n is taken as the XML template for the header.
Directing the JMS response to the response queue which PI JMS sender is polling
There is a special property for the response message which describes how the response message is created. The available values are:
- empty: empty response is returned.
- jms : proper JMS response is returned.(this case)
- echo: the request message itself is returned.
- status : status of the message
You can add additional parameter in your channel configuration. For example:
- trp response empty(you can put also jms,echo or status).
following value should be set in the module configuration in the channel to tell TIBCO as to which queue it should use to put the response message back.
JMSReplyTo attribute should be automatically filled with the response queue that AXIS has generated, and queue name should be resp<queue name where response is to be sent to>
Transport.jms.jmsReplyTo = respDummy.ES.CDX_PGMS_CashPoolingAccount.001.Request.GetCashBalance.001
where the assigment on the right side shows the name of the response queue where the message can be put. The same name of the queue can be used for the sender JMS adapter configuration to get the response message back.
Removing the Custom message header from the incoming response message.
Module parameter java:com.sap.aii.axis.soap.HeaderRemovalHandler should be used for module key hdr in the PI sender JMS adapter channel to strip the incoming message of the custom message header that TIBCO JMS meesage has added to it. Once done the same nessage comes with only stadard header and can be processed by PI and sent back to the calling system.
Message that can be seen in the TIBCO monitoring.
As can be seen in the TIBCO message queue that response message has been put inot the response queue which is being polled by PI sender JMS channel from where it can be picked up and further proceed by SAP PI sender channel.
2258 is the sender queue we are calling and delivering the message to.
2254 is the response queue created by AXIS where we are listening and response is returned.