Topic
4 replies Latest Post - ‏2013-02-15T19:10:04Z by JasonJava
JasonJava
JasonJava
54 Posts
ACCEPTED ANSWER

Pinned topic How to capture / duplicate response message in MQ queue ?

‏2013-02-14T23:43:05Z |
We have a WS proxy that receives a WS call, communicate with backend mainframe system via MQ and CICS bridge then sending response XML back to the client after transform the ebcdic to XML.

Currently, the response came back and failed in our WTX mapping (ebcdic to XML). So we are trying to capture the response to see its content.

I am trying to capture the response by adding the following in the response flow so that it gets copied to another queue, but it does not work.

Any idea how to capture and copy the response in another queue ?
Try to capture in response flow.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
extension-element-prefixes="dp" exclude-result-prefixes="dp"
xmlns:date="http://exslt.org/dates-and-times">

<xsl:template match="/">

<dp:url-open target="dpmq://MQMW_NGDC/?RequestQueue=TEMP.QL;AsyncPut=true" response="ignore">
<xsl:copy-of select="*"/>
</dp:url-open>

</xsl:template>

</xsl:stylesheet>
With dynamic backend settings, we have the following to setup and remote request queue and response local queue.

Define backend MQ connection in Request flow


<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
extension-element-prefixes="dp" exclude-result-prefixes="dp"
xmlns:date="http://exslt.org/dates-and-times">

<xsl:template match="/">

<!-- Step 1: Setup request remote queue and response local queue -->

<xsl:variable name="QR" select="'DP.CICSAGUN.NBSUITE.REQ.QR'"/>
<xsl:variable name="QL" select="'CICSAGUN.DP.NBSUITE.RES.QL'"/>
<xsl:variable name="backsideQueue" select="concat('dpmq://MQMW_NGDC/?RequestQueue=',$QR,';ReplyQueue=',$QL)"/>
<dp:set-variable name="'var://service/routing-url'" value="$backsideQueue" />

<xsl:variable name="MQMDHeader">
<MQMD>
<Format>MQCICS</Format><CodedCharSetId>500</CodedCharSetId><Encoding>785</Encoding><Version>2</Version><MsgType>1</MsgType>
<ReplyToQ><xsl:copy-of select="$QL" /></ReplyToQ>
<Report>3</Report>
<Persistence>1</Persistence>
<CorrelId>414D51214E45575F53455353494F4E5F434F5252454C4944</CorrelId>
</MQMD>
</xsl:variable>

<!-- Step 2: Seriable MQ Header variables -->

<xsl:variable name="mqmdSerialised">
<dp:serialize select="$MQMDHeader" omit-xml-decl="yes"/>
</xsl:variable>

<!-- Step 3: Set MQ Headers on the Request -->

<dp:set-request-header name="'MQMD'" value="$mqmdSerialised"/>

</xsl:template>

</xsl:stylesheet>
Updated on 2013-02-15T19:10:04Z at 2013-02-15T19:10:04Z by JasonJava
  • HermannSW
    HermannSW
    2817 Posts
    ACCEPTED ANSWER

    Re: How to capture / duplicate response message in MQ queue ?

    ‏2013-02-15T08:26:08Z  in response to JasonJava
    If for some reason the output of the WTX transform is not valid XML, then the <xsl:copy-of select="*"> cannot be used.

    Is turning on Probe an option for you?
    Then you can see the result of WTX transform in its output context.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    • JasonJava
      JasonJava
      54 Posts
      ACCEPTED ANSWER

      Re: How to capture / duplicate response message in MQ queue ?

      ‏2013-02-15T17:36:26Z  in response to HermannSW
      Thanks for the comments.

      Actually, I am trying to use that XSL to capture it or send to another MQ queue BEFORE the WTX transformation (EBCDIC to XML) in the response flow. Based on what you mentioned, it seems that only valid XML can be copied to another queue using <xsl:copy-of select="*">. Since the response is in EBCDIC format, it fails.

      Also, we did use probe but it just shows a generic transformation failure message. That is why we try to copy the MQ message in EBCDIC format to another MQ queue so we can use RFHUTIL to analyze its content.

      I guess my question would be what can be done to capture and copy a binary format message to another queue in DataPower (Our DP version is (XI50.5.0.0.1, Build:215672) ?