|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Creating full message from BLOB |
« View previous topic :: View next topic » |
Author |
Message
|
fitzcaraldo |
Posted: Tue May 16, 2006 4:29 am Post subject: Creating full message from BLOB |
|
|
Voyager
Joined: 05 May 2003 Posts: 98
|
I am trying to write a procedure to store a full copy of a message (including the RFH2) in a database for later retrieval.
I take a copy of the message as follows:
Code: |
declare messageToStore BLOB;
SET messageToStore = ASBITSTREAM(InputRoot,
InputRoot.MQMD.Encoding,
InputRoot.MQMD.CodedCharSetId,
InputRoot.Properties.MessageSet,
InputRoot.Properties.MessageType,
InputRoot.Properties.MessageFormat) ; |
I then store it in a database. This all seems to work fine.
When I retrieve it I do the following:
Code: |
set OutputRoot = NULL;
CREATE FIRSTCHILD of OutputRoot PARSE(messageToStore, InputRoot.MQMD.Encoding, InputRoot.MQMD.CodedCharSetId) ;
|
However the resulting message has the structure:
Code: |
OutputRoot.Root.MQMD...
OutputRoot.Root.MQRFH2...
etc
|
ie it has an extra 'Root' folder. Anyone got any idea why? |
|
Back to top |
|
 |
madi |
Posted: Tue May 16, 2006 6:25 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
I think that is how parse works
u can say PARSE(MSG,InputRoot.MQMD ..., CodedCharSetId,'','','XML') and the tree will be created under XML
otherwise it just defaults to Root which is happening in ur case
what you can do is just add the code
OutpuRoot = OutputRoot.Root;
delete field OutputRoot.Root;
and everything is good to go
--madi
Last edited by madi on Tue May 16, 2006 7:03 am; edited 1 time in total |
|
Back to top |
|
 |
kimbert |
Posted: Tue May 16, 2006 6:45 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
So...you needed information about the MessageSet, MessageType and MessageFormat in order to serialize this message ( see the ASBITSTREAM call ) but you expected it to get parsed without any of that information!
This problem has been solved dozens of times on this forum. Use the Search button , and look for 'CREATE FIELD PARSE MRM'. |
|
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
|
|
|
|