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 message being generate by stored proc called in Compute

Post new topic  Reply to topic
 XML message being generate by stored proc called in Compute « View previous topic :: View next topic » 
Author Message
EvolutionQuest
PostPosted: Thu Sep 18, 2003 11:17 am    Post subject: XML message being generate by stored proc called in Compute Reply with quote

Voyager

Joined: 18 Sep 2001
Posts: 88
Location: Billings, MT

We have a stored procedure in a Compute Node that generates an XML message and returns it into a declared character variable. That variable is then set to the OutputRoot.XML so it can be written to the MQOutput Node. The problem is the message in the output node has the '<', '>', and '"' as '&lt:', '&gt:', '&quote:'. So, in summary it is not translating the in-from/out-to symbols correctly.

Has anyone seen this, and second of all can taking a XML character string being generated by an external call be set correctly in the OutputRoot.XML variable?

DECLARE myXML CHARACTER;
DECLARE returncode INTEGER;
DECLARE message CHARACTER;
CALL MyProc(myXML, returncode, message);
SET OutputRoot.XML = myXML;
CREATE PROCEDURE MyProc (
OUT newXMLmessage CHARACTER,
OUT returncode INTEGER,
OUT message CHARACTER
) EXTERNAL NAME "MySchema.MyProc";
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
EvolutionQuest
PostPosted: Fri Sep 19, 2003 6:55 am    Post subject: Reply with quote

Voyager

Joined: 18 Sep 2001
Posts: 88
Location: Billings, MT

Could the problem be associated with an EBCDIC to ASCII translation being that the DB2 is on OS/390 and the flows are on distrib?
_________________
Don't blame technology, for technology was created by humans!
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Craig B
PostPosted: Fri Sep 19, 2003 12:34 pm    Post subject: Reply with quote

Partisan

Joined: 18 Jun 2003
Posts: 316
Location: UK

Hi,

Im kind surprised you got any XML output at all for this sample ESQL. When you manipulate the OutputRoot.XML folder, then you build up a hierarchy of message tree fields, from which an XML message bitstream will be created on the Output node.

In your ESQL you have :

Code:

SET OutputRoot.XML = myXML;


In this your 'myXML' is a character variable that contains from what I am reading is an XML data stream. So for example, you are doing the equivalent to :

Code:

SET OutputRoot.XML = '<myMessage><Text>Hello</Text></myMessage>';


So in affect you attempting to use a message tree, but giving it the XML message output you actually want to see. So this is really going against what the message tree is actually used for. When I use the ESQL above, then this generates a BIP5005E error message indicating that the XML message was not valid. This is because a root element is expected, and the XML parser would have attempted to traverse to the first child of the XML folder, and one does not exist. Hence an empty message is written.

So as you can see, Im not sure how an output message was generated. One possibility is that you sent in an XML message, and have done a SET OutputRoot = InputRoot at the start of this node. This would then give you the XML message you sent in, and so the input bitstream is just written straight to output for performance reasons. Therefore if your input XML message contained unescaped characters, these would be seen in the output. Anyway, I dont think it matters how you got the output you were seeing when you should have got an error.

If you modified your ESQL to something like the following :

Code:

SET OutputRoot.XML.myRoot = '<myMessage><Text>Hello</Text></myMessage>';


Then this would be successfull. But I imagine that you dont want an extra root tag in your output message above and beyond the one you already have coming from the database.

So you have two choices. You can either take your Character XML from the database and cast it to a BLOB and then perform a CREATE with PARSE to get you a valid XML message tree created from OutputRoot.XML. However, if you dont plan to modify this message in anyway, then the MQOutput node will just take this message tree and compress back into the output bitstream again. So if you have no intention of modifying this data then you might as well just do away with the XML folder, and output it in the BLOB domain. So for example :

Code:

DECLARE myDBDataCCSID INT;
SET myDBDataCCSID = 1208;
SET OutputRoot."BLOB"."BLOB" = CAST(myXML AS BLOB CCSID myDBDataCCSID);


This will give you the output message using the XML from the database, and will also help you factor in codepages of data in the backend database. The CCSID parm in the CAST function is used to say "my data is in this codepage", so you need to make sure you specify the correct codepage value in this call to make this successful.
_________________
Regards
Craig
Back to top
View user's profile Send private message
EvolutionQuest
PostPosted: Fri Sep 19, 2003 1:36 pm    Post subject: Reply with quote

Voyager

Joined: 18 Sep 2001
Posts: 88
Location: Billings, MT

Thank you.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger 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 » XML message being generate by stored proc called in Compute
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.