ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere DataPowerMQRFH2 Header does not get created in Datapower

Post new topicReply to topic
MQRFH2 Header does not get created in Datapower View previous topic :: View next topic
Author Message
Angshuman
PostPosted: Thu Nov 25, 2010 1:22 am Post subject: MQRFH2 Header does not get created in Datapower Reply with quote

Apprentice

Joined: 30 Apr 2009
Posts: 29

Hi,

I have created a MPG-MQ FSH, I am trying to set the MQRFH2 in request header. I could see the header getting populated in probe, but when I browse the message in RFHUtil, I don't see the RFH header, as it has not get created.

Also, I have set the MQMD format as "MQHRF2", but it reflects as "MQSTR" in RFHutil.

Please suggest.

Below is the snippet.

Code:


 <xsl:variable name="RFH2">
      <MQRFH2>
     <Version>2</Version>
          <Format>MQSTR</Format>
          <NameValueData>
            <NameValue>
                <usr>
                   <xsl:element name="MsgId"><xsl:value-of select="$MsgId"/></xsl:element>         
                </usr>
            </NameValue>
     </NameValueData>
       </MQRFH2>
 </xsl:variable>

<!-- Serializing the XML -->
<xsl:variable name="RFH2string"> <dp:serialize select="$RFH2" omit-xml-decl="yes" /></xsl:variable>

<!-- Setting teh request header -->

<dp:set-request-header name="'MQRFH2'" value="$RFH2string" />

Back to top
View user's profile Send private message
harish_td
PostPosted: Thu Nov 25, 2010 6:01 pm Post subject: Reply with quote

Master

Joined: 13 Feb 2006
Posts: 236

This has worked for me before.
Code:
      <!--Get existing MQMD variable if one exists and change the format to indicate presence of MQRFH2 Header-->
      <xsl:variable name="MQMD">
         <xsl:value-of select="dp:request-header('MQMD')" disable-output-escaping="yes"/>
      </xsl:variable>
      <xsl:variable name="newMQMD">
         <MQMD>
            <xsl:copy-of select="$MQMD/MQMD/*"/>
            <Format>
               <xsl:value-of select="'MQHRF2  '"/>
            </Format>
         </MQMD>
      </xsl:variable>
      <!--Set new MQMD Variable-->
      <xsl:variable name="serializedMQMD">
         <dp:serialize select="$newMQMD"/>
      </xsl:variable>
      <dp:set-request-header name="'MQMD'" value="$serializedMQMD"/>


      <xsl:variable name="newMQRFH2">
         <MQRFH2>
            <!--<Version>
               <xsl:value-of select="'MQRFH_VERSION_2'"/>
            </Version>
            <Encoding>
               <xsl:value-of select="'MQENC_NATIVE'"/>
            </Encoding>
            <CodedCharSetId>
               <xsl:value-of select="'MQCCSI_Q_MGR'"/>
            </CodedCharSetId>-->
            <Format>
               <xsl:value-of select="'MQSTR   '"/>
            </Format>
            <NameValueData>
               <NameValue>
                  <usr>
                     <Ref>
                        <xsl:value-of select="'ABCDEF12345'"/>
                     </Ref>
                  </usr>
               </NameValue>
            </NameValueData>
         </MQRFH2>
      </xsl:variable>

      <!--Set new MQRFH2 Variable-->
      <xsl:variable name="serializedMQRFH2">
         <dp:serialize select="$newMQRFH2"/>
      </xsl:variable>
      <dp:set-request-header name="'MQRFH2'" value="$serializedMQRFH2"/>
Back to top
View user's profile Send private message Yahoo Messenger
Angshuman
PostPosted: Fri Nov 26, 2010 12:32 am Post subject: MQRFH2 Header does not set in DP when using context var Reply with quote

Apprentice

Joined: 30 Apr 2009
Posts: 29

Hi Thanks Harish for the quick response.

In my case, I have to propagate the same message to multiple destinations, and I am using context variable to set the routing URL.
In my case, it returns 3 URLs, and I am using this context variable to set the routing URL.

Code:


<xsl:for-each select="./row">
   <xsl:for-each select="./column">
         <xsl:if test="./name = 'INT_DEST_URI_TX'">
         <url input="dp:variable('var://context/message/msg1')"><xsl:value-of select="./value"/></url>   
      </xsl:if>
   </xsl:for-each>
</xsl:for-each>



The above code returns more than 1 URL.
I have set this context variable path in Result Asynch action. It sends the message to the destinations but without the RFH header.

Anyone, please let me know if my approach to set the distribution list is incorrect.
Back to top
View user's profile Send private message
Angshuman
PostPosted: Fri Nov 26, 2010 12:49 am Post subject: Reply with quote

Apprentice

Joined: 30 Apr 2009
Posts: 29

Sorry typo, what I meant was the XSL works when you hardcode the backend URL, or when you set the backend URL dynamically in service var routing-URL.

But not when you set it in context var. I am using context var to set my URLs as I cannot use service-URL because I have to use a destination list, and at run-time I will know as how many queues to route to.

I am new to Datapower, let me know if my approach is not advisable.
Back to top
View user's profile Send private message
harish_td
PostPosted: Fri Nov 26, 2010 2:00 am Post subject: Reply with quote

Master

Joined: 13 Feb 2006
Posts: 236

[MODERATOR] Please help to split this thread. Thanks [/MODERATOR]

It is good forum etiquette to open a new thread for a new question;
Would also help future users in their searches and not get misled by the heading of the post

For dynamic queues population, the routing URL would not work as the Results Action would just identify the first value assigned to the variable
Code:
var://service/routing-url


I have used this before for a requirement, maybe you can build on top of it by enclosing it in a loop to iterate over your queue destinations

Code:
      <!-- Check Logging Flag to output transaction to a queue -->
      <xsl:if test="$Logging='1'">
         <xsl:variable name="LogDestination" select="concat('dpmq://SERVER-CONN-CHL/?RequestQueue=',$LogQueue1)"/>
         <xsl:message dp:priority="alert">
            <xsl:value-of select="$LogDestination"/>
         </xsl:message>
         <dp:url-open target="{$LogDestination}" response="ignore">
            <dp:serialize select="/" omit-xml-decl="yes"/>
         </dp:url-open>
      </xsl:if>



Lots of useful pointers by senior DataPower users can be found at the below forum also
http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1198&start=0
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere DataPowerMQRFH2 Header does not get created in Datapower
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.