|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Represent an XML as type character |
« View previous topic :: View next topic » |
Author |
Message
|
wendy |
Posted: Thu May 15, 2003 7:07 am Post subject: Represent an XML as type character |
|
|
Apprentice
Joined: 10 Dec 2001 Posts: 47
|
I have an XML input to a WMQI flow.The input node has a validation option set for a specific Message set(XSD).The incoming message is of the following XML Message.
</CrfActionGroup>
<COMMAND>
<InquiryRequest><Message> <contractNo>0015922583</contractNo>
<effectiveDate>2001-04-14</effectiveDate>
</Message>
</InquiryRequest>
</name>tdterd</name>
</COMMAND>
How do I represent InquiryRequest content i.e.
<Message> <contractNumber>0015922583</contractNumber>
<effectiveDate>2001-04-14</effectiveDate>
</Message>
as data string not an a complex XML type with elements? Is there a cancellation character or declaration that i need to make so that the WMQI flow recognise complex Type Messsage as a string instead of XML.Please help ASAP.
Wendy |
|
Back to top |
|
 |
wolstek |
Posted: Fri May 16, 2003 5:56 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 52 Location: Bristol, UK
|
|
Back to top |
|
 |
Craig B |
Posted: Wed Jun 18, 2003 7:40 am Post subject: |
|
|
Partisan
Joined: 18 Jun 2003 Posts: 316 Location: UK
|
From the description given it would seem that you want the actual text <Message><contractNumber>0015922583</contractNumber><effectiveDate>2001-04-14</effectiveDate></Message> from the XML message instead of accessing the individual fields that would have been created in the message tree when this is parsed. If this is the case and you are on WMQI V2.1 CSD03 or higher, then you can make use of the new ASBITSTREAM function. Unlike the BITSTREAM function the ASBITSTREAM function can return a BLOB of a selected Folder/field in the message tree. Once you have a BLOB of the high level folder, in this case Message, then you can use the CAST function with the CCSID and ENCODING keywords to produce you the character string you require. For example :
Code: |
DECLARE myMsgBlob BLOB;
DECLARE myMsgChar CHAR;
SET myMsgBlob = ASBITSTREAM(InputRoot.XML.myRoot.Message,
InputRoot.MQMD.Encoding,
InputRoot.MQMD.CodedCharSetId,
'','','',
FolderBitStream );
SET myMsgChar = CAST( myMsgBlob AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
|
The following points apply :
1) If you message is MRM-XML then you need to change the following :
i) The InputRoot.XML reference and the myRoot would need to be changed appropriately.
ii) The '','','' line would need to be changed to be the messageSet, messageType and messageFormat names for the MRM messageSet being used.
2) If this is being run on unix platforms then the whole XML message would be returned. This is due to problems with FolderBitStream which is due to be fixed in CSD05. _________________ Regards
Craig |
|
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
|
|
|
|