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 » Converting XML Data to BLOB

Post new topic  Reply to topic
 Converting XML Data to BLOB « View previous topic :: View next topic » 
Author Message
ashrain
PostPosted: Mon Mar 21, 2011 7:17 am    Post subject: Converting XML Data to BLOB Reply with quote

Novice

Joined: 16 Mar 2011
Posts: 12

Hi All, i need to decode the cdata section and sent the xml as blob.Any help please .Input message is

<?xml version="1.0"?>
<IBISMSG version="1.1">
<SYSHEADER>
<SERVICEID>tst2.testg</SERVICEID>
<TO>~~~~~~~~.~~~~~~~~~~~~</TO>
<FROM></FROM>
<MESSAGEGROUP>N</MESSAGEGROUP>
<MESSAGESEQ>000009</MESSAGESEQ>
<LASTMESSAGEGROUP>N</LASTMESSAGEGROUP>
<OUTTIMESTAMP>2011-03-18 16:22:09</OUTTIMESTAMP>
<UNIQUEID>20110321115809514071</UNIQUEID>
</SYSHEADER>
<APPDATA>
<APPHDR>
<MARKER>JFK</MARKER>
</APPHDR>
<CLIENT/>
<![CDATA[AUpGS0YzMTIgDQouV0FTVUNDUiBTRg0KAkZTTg0KICAgRlgNCiAgIC0gICAgICAgIC1INTQ0Nzg1OTU1DQpDU04vU1ItMS8NCgMNCg==]]>
</APPDATA>
</IBISMSG>
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Mar 21, 2011 8:01 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You need to write ESQL or Java to access the value of the CDATA Section.

Then similar code to decode it using whatever method has been used to encode it.
Back to top
View user's profile Send private message
ashrain
PostPosted: Mon Mar 21, 2011 8:06 am    Post subject: Reply with quote

Novice

Joined: 16 Mar 2011
Posts: 12

hello..I'm able to decode it now..but I need to send the message as blob data..please find below the esql :

--copy the entire message
CALL CopyEntireMessage();

DECLARE oleRef REFERENCE TO OutputLocalEnvironment.Variables;
DECLARE envRef REFERENCE TO Environment.Variables;

-- Switch Business service Id
CALL SwitchBSID(InputRoot.XML.IBISMSG.SYSHEADER.SERVICEID,envRef);
SET OutputRoot.XML.IBISMSG.SYSHEADER.SERVICEID = envRef.BSID.ABS_ID_OUT;

--route the message to the correct instance of quantum using the BSID
SET OutputLocalEnvironment.Destination.RouterList.DestinationData.labelName = envRef.BSID.ABS_ID_OUT;


DECLARE decodeChar CHAR InputRoot.XML.IBISMSG.APPDATA.(XML.CDataSection);

DECLARE base64Blb BLOB base64Decode(decodeChar);

SET OutputRoot.XML.IBISMSG.APPDATA.(XML.CDataSection) = base64Blb;

DECLARE inputData BLOB CAST (OutputRoot.XML AS BLOB CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding) ;

--SET OutputRoot.BLOB.BLOB = inputData;

CREATE LASTCHILD OF OutputRoot DOMAIN('BLOB') PARSE(inputData);
RETURN TRUE;
END;
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Mar 21, 2011 8:25 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You are trying to cast the field value of the OutputRoot.XML element.

This is not the same thing as the whole tree.

You SHOULD NOT be using the XML domain at all.
Back to top
View user's profile Send private message
ashrain
PostPosted: Mon Mar 21, 2011 8:31 am    Post subject: Reply with quote

Novice

Joined: 16 Mar 2011
Posts: 12

Any help please..how should I proceed with the esql.thank you in advance...
Back to top
View user's profile Send private message
paintpot
PostPosted: Mon Mar 21, 2011 8:48 am    Post subject: Reply with quote

Centurion

Joined: 19 Sep 2005
Posts: 112
Location: UK

Try creating the body with PARSE, if it is valid XML

If it is not, then you will need to explain your data and constraints more
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Mar 21, 2011 8:50 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

change your entire flow so it uses XMLNSC and not XML.

Change your CAST statement to something that works to serialize the tree rather than working with the root parser element of it.

There are probably 100 different threads in this forum that specifically discuss this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Converting XML Data to BLOB
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.