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 » FolderBitStream or toBitstream

Post new topic  Reply to topic
 FolderBitStream or toBitstream « View previous topic :: View next topic » 
Author Message
sudeepm
PostPosted: Wed Feb 20, 2008 10:35 pm    Post subject: FolderBitStream or toBitstream Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

toBitstream can only be used to create a message body i.e. last child of message root.

How can i use it for a particular portion of the Message body , not for the whole message.
Back to top
View user's profile Send private message
Gaya3
PostPosted: Wed Feb 20, 2008 11:36 pm    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

Hi

toBitstream is a java functionality,

Folder bitstream you can use it as an option in ASBITSTREAM (ESQL)

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
sudeepm
PostPosted: Wed Feb 20, 2008 11:38 pm    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

yeah..I know but i want to get Part of a message in Java not in ESQL.

Do u know how can i do that??
Back to top
View user's profile Send private message
Gaya3
PostPosted: Wed Feb 20, 2008 11:58 pm    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

Hi

I don't think that tobitstream will help you to extract a part of message

So extract it and use tobistream if u required

http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.etools.mft.broker.doc/com/ibm/broker/plugin/MbElement.html

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Feb 21, 2008 1:58 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You can't access FolderBitstream mode from Java.
You could do this, though:
- Create an MRM tree in the environment ( making sure that you specify DOMAIN 'MRM' when you create the root node !! )
- Copy the subtree that you need into the environment
- Define a message which describes that subtree. This is easy - just create a message based on the global element which describes the subtree. If it is not global, make it so.
- Use toBitstream, supplying the new message type.
Back to top
View user's profile Send private message
sudeepm
PostPosted: Thu Feb 21, 2008 2:27 am    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

yeah..i tried that but it did not work..

could you give me java code for the following ESQL code:

(ASBITSTREAM(InputRoot.XML.LogPayload.errorStackTrace OPTIONS FolderBitStream)
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Feb 21, 2008 2:43 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
it did not work
Great. You obviously don't think the problem is solvable, otherwise you would have given more info

Quote:
could you give me java code for the following ESQL code:

(ASBITSTREAM(InputRoot.XML.LogPayload.errorStackTrace OPTIONS FolderBitStream)
No. As it said in my earlier post, you cannot use FolderBitstream mode from Java. The 'Options' parameter on toBitstream() is explicitly documented as 'for future use'. That means 'Ignored in this version'.
Back to top
View user's profile Send private message
sudeepm
PostPosted: Thu Feb 21, 2008 2:56 am    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

kimbert wrote:
Quote:
it did not work
Great. You obviously don't think the problem is solvable, otherwise you would have given more info

Quote:
could you give me java code for the following ESQL code:

(ASBITSTREAM(InputRoot.XML.LogPayload.errorStackTrace OPTIONS FolderBitStream)
No. As it said in my earlier post, you cannot use FolderBitstream mode from Java. The 'Options' parameter on toBitstream() is explicitly documented as 'for future use'. That means 'Ignored in this version'.


Actually i tried this :

MbElement outRoot=outMessage.getRootElement();


outRoot.createElementAsLastChild(MbElement.TYPE_NAME,"Properties",null);
outRoot.createElementAsLastChild(MbElement.TYPE_NAME,"MQMD",null);
MbElement outBody=outRoot.createElementAsLastChild("MRM");
// MbElement payload=outBody.createElementAsLastChild(MbElement.TYPE_NAME,"Payload",null);
outBody.copyElementTree(somePayloadElt);
String data = null;

data = new String(outBody.toBitstream(null,null,null,0,0,0));

but it did not work
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Feb 21, 2008 3:03 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Code:
data = new String(outBody.toBitstream(null,null,null,0,0,0));

I'm not surprised it didn't work. Please do the following:
- Read the interface spec for toBitstream()
- Quote error messages when describing problems. Take a user trace if the error message is not detailed enough.
Please do not post again on this thread until you have done both of the above.
Back to top
View user's profile Send private message
sudeepm
PostPosted: Thu Feb 21, 2008 3:26 am    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

kimbert wrote:
Code:
data = new String(outBody.toBitstream(null,null,null,0,0,0));

I'm not surprised it didn't work. Please do the following:
- Read the interface spec for toBitstream()
- Quote error messages when describing problems. Take a user trace if the error message is not detailed enough.
Please do not post again on this thread until you have done both of the above.


Hi Kimbert,

i got the mistake.

Now I tried actually i tried this code :


outRoot.createElementAsLastChild(MbElement.TYPE_NAME,"Properties",null);
outRoot.createElementAsLastChild(MbElement.TYPE_NAME,"MQMD",null);
MbElement outBody=outRoot.createElementAsLastChild(MbElement.TYPE_NAME,MbXML.PARSER_NAME,null);
outBody.copyElementTree(somePayloadElt);


data = new String(outBody.toBitstream(null,null,null,0,0,0));

as i am not using the mrm so i can give null...

if I try the above code it does not give any error but i cannot see any data in data filed
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Feb 21, 2008 4:42 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

You should stop experimenting, and work out exactly what you are trying to do. Earlier you said that you wanted to work with InputRoot.XML. But your Java code is attempting to work with OutputRoot.MRM ( but specifying the XML domain ?? ).
If your code is not working and you do not see error messages, take a user trace.
Back to top
View user's profile Send private message
Tikam
PostPosted: Thu Feb 21, 2008 11:18 pm    Post subject: Copy the required SubTree to TempTree Reply with quote

Newbie

Joined: 15 Oct 2007
Posts: 4

Sudeep,

I had a similar problem and implimented it with Kimbert's way few moths earlier and it works...

Quote:

- Create an MRM tree in the environment ( making sure that you specify DOMAIN 'MRM' when you create the root node !! )
- Copy the subtree that you need into the environment
- Use toBitstream, supplying the new message type.

Here's the sample Code for it.

Code:

CREATE LASTCHILD OF ref_EnvVariables.FlowData DOMAIN 'MRM' NAME 'TempRoot';
DECLARE ref_TempRoot REFERENCE TO ref_EnvVariables.FlowData.TempRoot;
--Copy the subtree with some code
SET blb_OutputBLOB = ASBITSTREAM(ref_TempRoot, int_Encoding, int_CCSId, chr_MsgSetID, chr_MsgType, chr_MsgFormat);
DELETE FIELD ref_EnvVariables.FlowData.TempRoot;
--Cast the blb_OutputBLOB AS CHARACTER

But Obviously, this works in ESQL... never had any requirement to work with Java....But idea would be useful

Try copying the required subtree to some Temporary Root and the take toBitstream for it providing proper message type and format.

(Correct me if i m wrong...)

Regards,
Tikam
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 » FolderBitStream or toBitstream
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.