|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
assign xml string to a xml domain |
« View previous topic :: View next topic » |
Author |
Message
|
sangminli |
Posted: Tue Aug 31, 2010 6:44 pm Post subject: assign xml string to a xml domain |
|
|
 Voyager
Joined: 26 Aug 2008 Posts: 75 Location: Hangzhou, China
|
here, i am using a javacompute node to read a xml file, and I'd like to add this xml file as a child of Environment as xmlnsc domain, so I can reference the value very easily, then I don't need to manipulate the xml as a string to get the value I want.
below are the codes I used:
MbElement failedMsgAsXml = environment.createElementAsLastChild(MbXMLNSC.PARSER_NAME);
failedMsgAsXml.setValue(envDataFromFile);
and it reports errors:
Excptn:( ['MQROOT' : 0x1142788d0]
(0x01000000:Name):RecoverableException = (
(0x03000000:NameValue):File = '/build/S610_P/src/DataFlowEngine/PluginInterface/ImbJniNode.cpp' (CHARACTER)
(0x03000000:NameValue):Line = 1028 (INTEGER)
(0x03000000:NameValue):Function = 'ImbJniNode::evaluate' (CHARACTER)
(0x03000000:NameValue):Type = 'ComIbmJavaComputeNode' (CHARACTER)
(0x03000000:NameValue):Name = 'XMG300_UXMQS218_MSG_MQSI_FAIL#FCMComposite_1_2' (CHARACTER)
(0x03000000:NameValue):Label = 'XMG300_UXMQS218_MSG_MQSI_FAIL.FailedMsgHeader' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPv610' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number = 2230 (INTEGER)
(0x03000000:NameValue):Text = 'Caught exception and rethrowing' (CHARACTER)
(0x01000000:Name ):RecoverableException = (
(0x03000000:NameValue):File = 'MbElement.java' (CHARACTER)
(0x03000000:NameValue):Line = 1464 (INTEGER)
(0x03000000:NameValue):Function = 'setValue' (CHARACTER)
(0x03000000:NameValue):Type = '' (CHARACTER)
(0x03000000:NameValue):Name = '' (CHARACTER)
(0x03000000:NameValue):Label = '' (CHARACTER)
(0x03000000:NameValue):Catalog = 'BIPv610' (CHARACTER)
(0x03000000:NameValue):Severity = 0 (INTEGER)
(0x03000000:NameValue):Number = 4373 (INTEGER)
(0x03000000:NameValue):Text = 'Invalid element value type' (CHARACTER)
(0x01000000:Name ):Insert = (
(0x03000000:NameValue):Type = 5 (INTEGER)
(0x03000000:NameValue):Text = 'com.ibm.broker.plugin.MbElement' (CHARACTER)
)
)
)
)
so what is right way to achieve this? |
|
Back to top |
|
 |
kimbert |
Posted: Wed Sep 01, 2010 1:22 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
You cannot assign an unparsed XML document to an XMLNS/XMLNSC message tree.
If you want to preserve the original XML, then you can create a BLOB in the Environment or localEnvironment and assign InputRoot.BLOB.BLOB to it.
If you want to access the contents of the XML document then you must parse the document and copy the parsed message tree into the (Local)Environment.
If you copy an XMLNSC message tree into (Local)Environment, make sure that you create the parent node using the DOMAIN 'XMLNSC' clause. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 01, 2010 1:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I think you want createElementAsLastChildFromBitstream |
|
Back to top |
|
 |
sangminli |
Posted: Thu Sep 02, 2010 1:16 am Post subject: |
|
|
 Voyager
Joined: 26 Aug 2008 Posts: 75 Location: Hangzhou, China
|
thanks very much for your input, and I took your advice and it works.
below are the codes I use:
MbElement envFailedMsgXml = environment.createElementAsLastChildFromBitstream(bytesDataFromFile,
MbXMLNSC.PARSER_NAME, null, null, null, Integer.parseInt(inMQMD.getFirstElementByPath("Encoding").getValue().toString()),
Integer.parseInt(inMQMD.getFirstElementByPath("CodedCharSetId").getValue().toString()),0);
Thanks again!  |
|
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
|
|
|
|