Author |
Message
|
sudeepm |
Posted: Wed Feb 20, 2008 10:35 pm Post subject: FolderBitStream or toBitstream |
|
|
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 |
|
 |
Gaya3 |
Posted: Wed Feb 20, 2008 11:36 pm Post subject: |
|
|
 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 |
|
 |
sudeepm |
Posted: Wed Feb 20, 2008 11:38 pm Post subject: |
|
|
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 |
|
 |
Gaya3 |
Posted: Wed Feb 20, 2008 11:58 pm Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
|
Back to top |
|
 |
kimbert |
Posted: Thu Feb 21, 2008 1:58 am Post subject: |
|
|
 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 |
|
 |
sudeepm |
Posted: Thu Feb 21, 2008 2:27 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Thu Feb 21, 2008 2:43 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
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 |
|
 |
sudeepm |
Posted: Thu Feb 21, 2008 2:56 am Post subject: |
|
|
Acolyte
Joined: 31 Jan 2008 Posts: 57
|
kimbert wrote: |
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 |
|
 |
kimbert |
Posted: Thu Feb 21, 2008 3:03 am Post subject: |
|
|
 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 |
|
 |
sudeepm |
Posted: Thu Feb 21, 2008 3:26 am Post subject: |
|
|
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 |
|
 |
kimbert |
Posted: Thu Feb 21, 2008 4:42 am Post subject: |
|
|
 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 |
|
 |
Tikam |
Posted: Thu Feb 21, 2008 11:18 pm Post subject: Copy the required SubTree to TempTree |
|
|
 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 |
|
 |
|