|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MbElement.detach(), MessageTree |
« View previous topic :: View next topic » |
Author |
Message
|
michael.da |
Posted: Fri May 12, 2006 12:46 am Post subject: MbElement.detach(), MessageTree |
|
|
Novice
Joined: 30 Mar 2006 Posts: 13 Location: Frankfurt / Germany
|
Hi!
Somethinks wrong with MbElement.detach()?
In a java compute node I try to generate an xml-file output of my message in this way:
public void evaluate( MbMessageAssembly assembly, MbInputTerminal in)
throws MbException
{
[…]
MbMessage msg = assembly.getMessage();
byte[] bitstream = msg.getBuffer();
[…]
.[…]
FileOutputStream outputStream = new FileOutputStream(myfile);
outputStream.write(bitstream);
outputStream.close();
[…]
}
Now I have body of my message in a xml file, but the mqmd header information, too.
The structure of a message tree is:
................+----+
................|Root|
................+----+
................./....\
.............../........\
............./............\
.........../................\
........./....................\
+----------+...+----+...+---+
|Properties|--|MQMD|--|XML|
+----------+...+----+...+---+
thus, after creation of a new outAssembly, I tried do detach the mqmd from my contact admin.getMessage() with:
MbElement mqmdHeader = contact admin.getMessage().getRootElement().getFristChild().getNextSibling();
mqmdHeader.detach();
but detach() doesn’t works and my code jumps into the catch-block.
Regards
Michael |
|
Back to top |
|
 |
wschutz |
Posted: Fri May 12, 2006 6:16 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Michael...I wouldn't think you'd be able to detach from the contact admin. Have you tried making a copy (outAssembly) and detaching there? _________________ -wayne |
|
Back to top |
|
 |
michael.da |
Posted: Fri May 12, 2006 7:34 am Post subject: |
|
|
Novice
Joined: 30 Mar 2006 Posts: 13 Location: Frankfurt / Germany
|
Wayne,
Apparently you are right! First I’ve only made a copy of my MbMessage, but this seems to be not enough. After your reply I’ve made a copy of my entire MbMessageAssembly and now everything works fine.
Thanks
Michael |
|
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
|
|
|
|