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 Index » IBM MQ API Support » PERL : MQSeries: Data in RFH2 Header

Post new topic  Reply to topic
 PERL : MQSeries: Data in RFH2 Header « View previous topic :: View next topic » 
Author Message
herrman77
PostPosted: Thu Apr 19, 2012 10:58 pm    Post subject: PERL : MQSeries: Data in RFH2 Header Reply with quote

Newbie

Joined: 19 Apr 2012
Posts: 2

Hello,

I want to send Data in the RFH2 Header. My Data has to be located in the usr Folder of the RFH2 Header.

But now to my little Problem. I could not find Information to solve the Problem by myself.
I have to send three Data Values included in the usr folder of the RFH2 Header in MQ Series Messages.
I am able to create a message and send it to the Targetqueue. In the Messages received at the Targetqueue there is no data in the rfh2 Header.

I'm using Perl 5.8.8

I'm afraid the Datafields NameValueData and NameValueLength are not supported in the Perl Module MQSeries::Message::RFH2.

Is it correct, that i have to put my Information in want to transmit in the rfh2 HEader have to be located in the NameValueData?
Does Anybody know how to transmit Data in the rfh2 header via Perl API?



This is the Code Sample how i create the Message.

Code:
use MQSeries;
use MQSeries::QueueManager;
use MQSeries::Queue;
use MQSeries::Message;
use MQSeries::Message::RFH2;


# Queue Connection
my $Q = MQSeries::Queue->new (
                                       QueueManager => $qmgr,
                                        Queue        => $sendq,
                                         Mode         => 'output',
                                    ) || die $D->P("Unable to open queue.\n"); # Logging


# Message Creation
my $message = MQSeries::Message::RFH2->new(
      MsgDesc => {   CodedCharSetId => 819,
         Format => 'MQHRF2',
         ReplyToQ => $replyq,
         ReplyToQMgr => $qmgr,
         },
      Header => {
         StrucId  => 'RFH',
         Version => 2,
         Struclength => 52,
         Encoding => 819,
         CodedCharSetId => 819,
         Format => 'MQSTR',
         Flags =>  0,
         NameValueCCSID => 1208,
         NameValueData => $mqheader_data,       # This is the XML Structure with my three Data Values
         NameValueLength => $byte_size,           # size of my Data in the Header      
        },
      Data => $output,
          ) || die $D->P("Could not Create Message ");   # Logging


      $Q->Put(
              Message => $message
             ) || die $D->P("Unable to put message onto queue.\n" . "CompCode = " . $Q->CompCode() . "\n" ."Reason = " . $Q->Reason() . "\n"); # Logging
             


# For Information This is how the xml Structur for NameValueData was created
my $mqheader_data = "<usr><ars_service>$ars_service</ars_service><persk>$personalnummer</persk><arsID>$ID</arsID></usr>";

I hope this is no stupid question or I wasn’t just to stupid to find the required Documentation.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 20, 2012 4:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

If you're using WMQv7 the RFH2 has been replaced by message properties. Depending on the compatability settings of the queue manager any RFH2 may have been automatically converted into properties.

As to how this all works in Perl, our resident Perl expert will be along in a minute.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Apr 20, 2012 5:08 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

That doesn't appear to be how to use MQSeries::Message::MQRFH2.
http://search.cpan.org/~mqseries/MQSeries-1.32/MQSeries/Message/RFH2.pm

ALso, if you had used [ c o d e ] tags, I would have been able to tell if your use of 'RFH' properly had spaces or not.
Back to top
View user's profile Send private message
herrman77
PostPosted: Thu Apr 26, 2012 1:52 am    Post subject: Reply with quote

Newbie

Joined: 19 Apr 2012
Posts: 2

Thank You very much.
With the Hint about the Spaces in 'RFH ' i was able to create the RFH2 Header including my Data.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » PERL : MQSeries: Data in RFH2 Header
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.