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.toBitstream() returns an empty array

Post new topic  Reply to topic
 MbElement.toBitstream() returns an empty array « View previous topic :: View next topic » 
Author Message
mlce
PostPosted: Wed Jan 10, 2007 6:21 am    Post subject: MbElement.toBitstream() returns an empty array Reply with quote

Newbie

Joined: 10 Jan 2007
Posts: 4

I can't get MbElement.toBitstream() to work properly.

The following code snippet (Java Compute Node) returns en empty array:

Code:
public class JavaGdsVcomCsCall extends MbJavaComputeNode {

   private MbElementUtil util = new MbElementUtil();

   public void evaluate(MbMessageAssembly contact admin) throws MbException {
      try {
         // Get rootElement
         MbElement rootElement = contact admin.getMessage().getRootElement();

         // Get the data as a bitstream
         String requestMessageSet = "EGCJ700002001";
         String requestMessageType = "msg_R9I34101";
         String requestMessageFormat = "CWF";

         byte [] msgAsBytes = rootElement.getLastChild().toBitstream(requestMessageType,requestMessageSet,requestMessageFormat,0,0,0);

I have verified that the message sent into the Java Compute Node is of the Set and Type as specified above.

WMB version is 6.0.0.1.

Any clue on what I'm doing wrong?

Regards,
Magnus.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Jan 10, 2007 8:07 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
String requestMessageFormat = "CWF";
CWF1?
Back to top
View user's profile Send private message
mlce
PostPosted: Wed Jan 10, 2007 1:00 pm    Post subject: The Physical Format is actually named "CWF" Reply with quote

Newbie

Joined: 10 Jan 2007
Posts: 4

Thanks for your advice but I have actually named the Physical Format "CWF".

Are there any working examples on calling toBitstream() available?
Starting from something that actually works is maybe the easiest way forward...

Regards,
Magnus.
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Jan 11, 2007 1:23 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Have you tried searching for 'toBitstream()' on this forum?
Back to top
View user's profile Send private message
mlce
PostPosted: Thu Jan 11, 2007 7:03 am    Post subject: Reply with quote

Newbie

Joined: 10 Jan 2007
Posts: 4

Absolutelty, I read all 14 topics carefully

However, I got an suggestion to temporary replace the Java compute node by a MQ Output node to see what happens. The ideas was that if the message is successfully written to the MQ queue then the call to toBitstream() "should" work.

As you probably can imagine the message written to the queue also contained 0 bytes of data.

After finding the problem using the temporary MQ Output node I switched back to the Java Compute node...

...and the call to toBitstream() now works (of course)

So it was all a matter of finding a proper method for isolating the problem.

Thanks anyhow for your suggestions!

Regards,
Magnus.
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.toBitstream() returns an empty array
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.