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 » WebSphere Message Broker (ACE) Support » MbElement.detach(), MessageTree

Post new topic  Reply to topic
 MbElement.detach(), MessageTree « View previous topic :: View next topic » 
Author Message
michael.da
PostPosted: Fri May 12, 2006 12:46 am    Post subject: MbElement.detach(), MessageTree Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Fri May 12, 2006 6:16 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
michael.da
PostPosted: Fri May 12, 2006 7:34 am    Post subject: Reply with quote

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
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 » WebSphere Message Broker (ACE) Support » MbElement.detach(), MessageTree
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.