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 » XML in CDATA

Post new topic  Reply to topic
 XML in CDATA « View previous topic :: View next topic » 
Author Message
MBMQDeveloper
PostPosted: Tue Aug 21, 2012 1:12 am    Post subject: XML in CDATA Reply with quote

Novice

Joined: 02 Jul 2012
Posts: 19

Hi Every One,

I currently have a requirement where I have CDATA in the inbound xml. The CDATA contains an xml which needs to be extracted and sent to a different system. The sample xml is as below.

Code:

<Training_workspace>
   <MyApplication>
      <data>
         <![CDATA[<Message>
                  <SubElement1>Hello</SubElement1>
                  <SubElement2>World</SubElement2>
               </Message>
         ]]>
      </data>
   </MyApplication>
</Training_workspace>


I am able to successfully extract the content of the CDATA and able to store the same in an environment variable.

Code:

SET Environment.Variables.innerXML = FIELDVALUE(InputRoot.XMLNSC.Training_workspace.MyApplication.data);
SET OutputRoot.XMLNSC = Environment.Variables.innerXML;


I am able to see that outputroot with the required data in it, post the compute node. However, I am receiving a parser exception when I send the CDATA in the OutputRoot as an xml.

Exact Error is given below.
Code:

Severity:INTEGER:3
Number:INTEGER:5031
Text:CHARACTER:No root element was found while writing the XML message.


Can anyone of you please let me know the mistake here?
Back to top
View user's profile Send private message
MBMQDeveloper
PostPosted: Tue Aug 21, 2012 1:14 am    Post subject: Reply with quote

Novice

Joined: 02 Jul 2012
Posts: 19

MB version is 7.0.0.1
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 21, 2012 1:47 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You've done a number of things wrong.

First is not applying Fixpack 4 of v7.0.

It's not directly related to your problem, but it is a problem. Upgrade.

What is directly related to your problem is that Environment.Variables.innerXML does not have a parser associated with it, nor is it anything other than a character string.

Use OutputRoot.Blob instead of OutputRoot.XML.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Aug 21, 2012 1:51 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You need to either treat the Data as a BLOB or PARSE it:
Code:
SET OutputRoot.XMLNSC = PARSE( Environment.Variables.innerXML,...);


... check the syntax of the command
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML in CDATA
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.