Topic
4 replies Latest Post - ‏2013-01-02T22:44:55Z by swlinn
wfdpdeveloper
wfdpdeveloper
10 Posts
ACCEPTED ANSWER

Pinned topic Changing MQ Header values

‏2012-12-14T20:09:21Z |
Hi,

I am trying to change some MQ Header values in datapower, it is a queue to queue scenario - which means I have a MQ FSH and MQ back end...if I use the MQ header action, it works fine but when I write a style sheeet, probe shows as if the values have been changed but eventually when it reaches the MQ Queue (I am checking in MQ erplorer) it has default MQ header values..can anybody tell me why is this happening?

Also, if I use the advanced icon - MQ header.. I am unable to add extra parameters int he advanced tab..please explain if I am doing something wrong

Please find my XSL below:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dp="http://www.datapower.com/extensions" xmlns:dpconfig="http://www.datapower.com/param/config" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" extension-element-prefixes="dp" exclude-result-prefixes="dp dpconfig" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/">
<xsl:template match="/">
<xsl:variable name="mqmd_in_serialized" select="dp:request-header('MQMD')"/>
<xsl:variable name="mqmd_in" select="dp:parse($mqmd_in_serialized)"/>
<xsl:variable name="StrucId" select="$mqmd_in//StrucId/text()"/>
<xsl:variable name="Version" select="$mqmd_in//Version/text()"/>
<xsl:variable name="Report" select="$mqmd_in//Report/text()"/>
<xsl:variable name="MsgType" select="$mqmd_in//MsgType/text()"/>
<xsl:variable name="Expiry" select="$mqmd_in//Expiryv/text()"/>
<xsl:variable name="Feedback" select="$mqmd_in//Feedback/text()"/>
<xsl:variable name="Encoding" select="$mqmd_in//Encoding/text()"/>
<xsl:variable name="CodedCharSetId" select="$mqmd_in//CodedCharSetId/text()"/>
<xsl:variable name="Format" select="$mqmd_in//Format/text()"/>
<xsl:variable name="Priority" select="$mqmd_in//Priority/text()"/>
<xsl:variable name="Persistence" select="$mqmd_in//Persistence/text()"/>
<xsl:variable name="MsgId" select="$mqmd_in//MsgId/text()"/>
<xsl:variable name="CorrelId" select="$mqmd_in//CorrelId/text()"/>
<xsl:variable name="BackoutCount" select="$mqmd_in//BackoutCount/text()"/>
<xsl:variable name="ReplyToQ" select="$mqmd_in//ReplyToQ/text()"/>
<xsl:variable name="ReplyToQMgr" select="$mqmd_in//ReplyToQMgr/text()"/>
<xsl:variable name="UserIdentifier" select="$mqmd_in//UserIdentifier/text()"/>
<xsl:variable name="AccountingToken" select="$mqmd_in//AccountingToken/text()"/>
<xsl:variable name="ApplIdentityData" select="$mqmd_in//ApplIdentityData/text()"/>
<xsl:variable name="PutApplType" select="$mqmd_in//PutApplType/text()"/>
<xsl:variable name="PutApplName" select="$mqmd_in//PutApplName/text()"/>
<xsl:variable name="PutDate" select="$mqmd_in//PutDate/text()"/>
<xsl:variable name="PutTime" select="$mqmd_in//PutTime/text()"/>
<xsl:variable name="ApplOriginData" select="$mqmd_in//ApplOriginData/text()"/>
<xsl:variable name="mqmd_out">
<xsl:element name="MQMD">

</xsl:element>
<xsl:element name="MsgType">
<xsl:value-of select="$MsgType"/>
</xsl:element>

<xsl:element name="CodedCharSetId">
<xsl:value-of select="'25'"/>
</xsl:element>
<xsl:element name="Format">
<xsl:value-of select="'MQFMT_STRING'"/>
</xsl:element>

<xsl:element name="MsgId">
<xsl:value-of select="$MsgId"/>
</xsl:element>
<xsl:element name="CorrelId">
<xsl:value-of select="$MsgId"/>
</xsl:element>
</xsl:variable>
<xsl:variable name="mqmd_out_serialized">
<dp:serialize select="$mqmd_out" omit-xml-decl="yes"/>
</xsl:variable>
<dp:set-request-header name="'MQMD'" value="$mqmd_out_serialized"/>
<xsl:variable name="payload">
<xsl:copy-of select="."/>
</xsl:variable>
<dp:url-open target="dpmq://MQ_MGR/?RequestQueue=MYQueue">
<xsl:copy-of select="$payload"/>
</dp:url-open>
</xsl:template>
</xsl:stylesheet>
Updated on 2013-01-02T22:44:55Z at 2013-01-02T22:44:55Z by swlinn
  • Daviiid
    Daviiid
    282 Posts
    ACCEPTED ANSWER

    Re: Changing MQ Header values

    ‏2012-12-16T12:49:25Z  in response to wfdpdeveloper
    Hello
    I think Yougoslavie need to set PMO put option
    try to add PMO option with 1024
    • Daviiid
      Daviiid
      282 Posts
      ACCEPTED ANSWER

      Re: Changing MQ Header values

      ‏2012-12-16T12:51:18Z  in response to Daviiid
      Sorry. correction automatic. i wanted say : "I think you need" not "Yougoslavie"
  • T736_Mayur_Garg
    T736_Mayur_Garg
    16 Posts
    ACCEPTED ANSWER

    Re: Changing MQ Header values

    ‏2012-12-17T09:02:11Z  in response to wfdpdeveloper
    I guess you need to explicitly add your MQMD header to request message while doing DP URL open
    <dp:url-open target="dpmq://MQQMABC/?ReplyQueue=XYZ" http-headers="$headers"/>
    $header is your serialized MQMD header and any other header if applicable.
    • swlinn
      swlinn
      1344 Posts
      ACCEPTED ANSWER

      Re: Changing MQ Header values

      ‏2013-01-02T22:44:55Z  in response to T736_Mayur_Garg
      $header needs to conform to the url-open requirements, so

      <xsl:variable name="headers">
      <header name="MQMD"><xsl:value-of select="$serializedMQMD" /></header>
      </xsl:variable>
      


      Regards,
      Steve
      Updated on 2014-03-25T02:43:43Z at 2014-03-25T02:43:43Z by iron-man