Posted: Thu Sep 13, 2007 9:56 am Post subject: "UTF-8" (Unicode) message wrong after adding MQRFH
Newbie
Joined: 13 Sep 2007 Posts: 6
Hi
In Message Broker we have a simple flow where we map from XML to XML using the mapping node. We can send XML messages with Chinese characters and we set the CCSID (Coded Character Set IDentifier)= 1208 when we PUT the message in the input queue. This works OK since on the output queue of the flow we get a message with Chinese chars well formed.
The PROBLEM is that after adding a compute node (right after the mapping node) the (double byte) Chinese characters are corrupted/garbled. This compute node just includes an MQRFH2 header in the message as shown below:
CREATE COMPUTE MODULE GL_Cusdec_SAPtoBT_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
-- CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.MQMD = InputRoot.MQMD;
DECLARE inRef REFERENCE TO InputRoot.MRM.ESB_DOC.TX_METADATA;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = 'MQSTR ';
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';
SET OutputRoot.MQRFH2.mcd.Type = 'application/xml';
SET OutputRoot.MQRFH2.jms.Dlv = '1';
SET OutputRoot.MQRFH2.usr.x_aux_sender_id = inRef.sender_partner_id;
SET OutputRoot.MQRFH2.usr.x_aux_receiver_id = inRef.receiver_partner_id;
SET OutputRoot.MQRFH2.usr.x_aux_protocol = 'CANONICAL';
SET OutputRoot.MQRFH2.usr.x_aux_protocol_version = '1.0';
SET OutputRoot.MQRFH2.usr.x_aux_process_type = 'CustomsDecl';
SET OutputRoot.MQRFH2.usr.x_aux_process_version = '1.0';
SET OutputRoot.MQRFH2.usr.x_aux_msg_id = inRef.msg_id;
--SET OutputRoot.MQRFH2.usr.x_aux_production = inRef.test_flag;
SET OutputRoot.MQRFH2.usr.content_type = 'application/xml;charset=UTF-8';
SET OutputRoot.MRM = InputRoot.MRM;
RETURN TRUE;
END;
Any ideas about how to add an MQRFH2 header without messing with the double byte characters.
I have set OutputRoot.MQMD.Format to MQFMT_RF_HEADER_2 and OutputRoot.MQMD.CodedCharSetId to 1208 but still have the same problem: Chinese characters get garbled. But if I commented out the MQRFH2 code, Chinese characters are OK.
We found the problem. Actually it was they way we were looking at the output message. If we open the file with Notepad but we leave any of the message headers (MQMD or RFH) in the file then every double byte char shows as garble.
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