|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
c# code sample to read PCF response messages. |
« View previous topic :: View next topic » |
Author |
Message
|
mqtablet |
Posted: Thu Nov 18, 2010 3:11 am Post subject: c# code sample to read PCF response messages. |
|
|
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 |
|
 |
RogerLacroix |
Posted: Thu Nov 18, 2010 1:53 pm Post subject: |
|
|
 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 |
|
 |
mqtablet |
Posted: Thu Nov 18, 2010 8:20 pm Post subject: |
|
|
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 |
|
 |
shashikanth_in |
Posted: Thu Nov 25, 2010 8:06 pm Post subject: |
|
|
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 |
|
 |
mqtablet |
Posted: Fri Nov 26, 2010 9:34 am Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|