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 » c# code sample to read PCF response messages.

Post new topic  Reply to topic
 c# code sample to read PCF response messages. « View previous topic :: View next topic » 
Author Message
mqtablet
PostPosted: Thu Nov 18, 2010 3:11 am    Post subject: c# code sample to read PCF response messages. Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

hi,

i'm writing a C# application which sends a PCF message to a command input queue and the response is directed to a named local queue of a queue manager. When I send the command, the queue manager is successfully processing it and putting the response in the ReplyToQ as expected.

how do I read this PCF response message in an understandable manner?
Does any one have a code example for it?

websphere mq v7.0.1.3
windows 2003

i tried searching first in this forum, but did not find any post related to it.
if this is a duplicate, i apologize and request any one to reply with a link.

tx.
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Thu Nov 18, 2010 1:53 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

You should read the WMQ Programmable Command Formats and Administration Interface manual for information on how to handle PCF reply messages. To my knowledge, IBM has not created a PCFMessage class in C#.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
mqtablet
PostPosted: Thu Nov 18, 2010 8:20 pm    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

hi Roger,
thanks for your response. We do have PCFMessage class in c# (amqmdnet.dll).
Let me check out the document you refered. Thanks again!

regards,
R
Back to top
View user's profile Send private message
shashikanth_in
PostPosted: Thu Nov 25, 2010 8:06 pm    Post subject: Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

PCF classes in MQ .NET are undocumented. However people still use them.

Here is one sample I wrote.
try
{
PCFMessageAgent agent;
MQQueueManager qm = new MQQueueManager("MQQM");
agent = new PCFMessageAgent(qm);

PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q);
request.AddParameter(MQC.MQCA_Q_NAME, "TESTQ");
request.AddParameter(CMQCFC.MQIACF_Q_ATTRS, new int[]{MQC.MQCA_Q_NAME, MQC.MQIA_Q_TYPE, MQC.MQCA_Q_DESC}); ;

PCFMessage[] responses = agent.Send(request);

for (int i = 0; i < responses.Length; i++)
{
PCFMessage response = responses[i];

PCFParameter[] param = response.GetParameters();
foreach (PCFParameter p in param)
{
Console.WriteLine(p.Parameter);
Console.WriteLine(p.GetValue());
}
}
}
catch (MQException mqe)
{
Console.Write(mqe);
}
Back to top
View user's profile Send private message
mqtablet
PostPosted: Fri Nov 26, 2010 9:34 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jun 2009
Posts: 71

hi shashi,

thanks for your response. my bad and am sorry that I did not post my question properly. I'm rephrasing it here again.

I have created a MQ command message using the MQMessage class. I do not want to use the PCFMessage class to read the response message. I want to read it using the normal MQMessage class. In this MQMessage message properties, I've set the reply to queue name.

When I send this message to the command queue, the command server is successfully processing this message and also putting the response to the specified reply to queue.

Now, I want to read this response message, which is in the specified reply to queue. I know that the message is in PCF format in the queue, but I'm not sure how to read this message

Thanks,
Manoj
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 » c# code sample to read PCF response messages.
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.