|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Message service folders and MQRFH2 in Java compute node |
« View previous topic :: View next topic » |
Author |
Message
|
Pradee |
Posted: Fri Jul 29, 2011 8:23 am Post subject: Message service folders and MQRFH2 in Java compute node |
|
|
Newbie
Joined: 29 Jul 2011 Posts: 2
|
I am trying to create <usr> folder under MQRFH2 using the java compute node. I am using the RFHUtil to view the data and usr contents created under MQRFH2. The text "RFH" is added in the data part of the message. Please see the below data, and there is nothing in usr tab of RFHUtil. I have pasted the code that I am using to create the MQRFH2. This code is mentioned in IBM information centre. Please advice what mistake I am doing.
--------------------Data ----------------
RFH ¼"µMQSTR ¸„
<usr>
<RegOpt>PersAsPub</RegOpt>
<QName>PUBOUT</QName>
<QMgrName>QM1</QMgrName>
<Topic>department</Topic>
<Command>RegSub</Command>
</usr>
<mcd></mcd>
<request>
<operation>saveAddress</operation>
<Name>Dave1</Name>
<City>Carlisle</City>
<Street>Welton</Street>
<Province>Cumbria</Province>
<PostalCode>NE2 3HP</PostalCode>
<Area>1</Area>
<Prefix>2</Prefix>
<Local>3</Local>
</request>
----------------------------------Code ---
MbElement root = outMessage.getRootElement();
MbElement body = root.getLastChild();
// insert new header before the message body
MbElement rfh2 = body.createElementBefore("MQRFH2");
rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Version", new Integer(2));
rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "Format", "MQSTR");
rfh2.createElementAsFirstChild(MbElement.TYPE_NAME_VALUE, "NameValueCCSID", new Integer(1208));
MbElement psc = rfh2.createElementAsFirstChild(MbElement.TYPE_NAME, "usr", null);
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "Command", "RegSub");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "Topic", "department");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "QMgrName", "QM1");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "QName", "PUBOUT");
psc.createElementAsFirstChild(MbElement.TYPE_NAME, "RegOpt", "PersAsPub");
rfh2.createElementAsLastChild(MbElement.TYPE_NAME, "mcd", null);
MbXPath xp = new MbXPath("/MQMD/Format" + "[set-value(´MQRFH2´)]", root);
root.evaluateXPath(xp);
Last edited by Pradee on Fri Jul 29, 2011 8:46 am; edited 1 time in total |
|
Back to top |
|
 |
exerk |
Posted: Fri Jul 29, 2011 8:40 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Moving this to the Broker forum. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Jul 29, 2011 9:47 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
First off, when posting code, use the [ c o d e ] tags since it makes reading your post much easier.
Second off, your missing the question marks in your Xpath statements. A question mark means, if it doesn't exist, create it.
Here is a good reference on Xpath. http://www.regular-expressions.info/xpath.html
I'm not an Xpath Xpert, just a pert. Someone else may know more than I do or correct me if I am wrong. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
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
|
|
|
|