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 » assign xml string to a xml domain

Post new topic  Reply to topic
 assign xml string to a xml domain « View previous topic :: View next topic » 
Author Message
sangminli
PostPosted: Tue Aug 31, 2010 6:44 pm    Post subject: assign xml string to a xml domain Reply with quote

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
View user's profile Send private message MSN Messenger
kimbert
PostPosted: Wed Sep 01, 2010 1:22 am    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 01, 2010 1:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

I think you want createElementAsLastChildFromBitstream
Back to top
View user's profile Send private message
sangminli
PostPosted: Thu Sep 02, 2010 1:16 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » assign xml string to a xml domain
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.