Author |
Message
|
jorgego |
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.
Thanks !
JORGE. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 13, 2007 10:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to set OutputRoot.MQMD.Format=MQFMT_RF_HEADER_2 or whatever the actual name of the constant is.
You should also set MQMD.CCSID to 1208. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jorgego |
Posted: Thu Sep 13, 2007 6:59 pm Post subject: |
|
|
Newbie
Joined: 13 Sep 2007 Posts: 6
|
jefflowrey, thanks for your response.
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.
Jorge. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 13, 2007 7:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20763 Location: LI,NY
|
Quote: |
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208; |
So what are you setting the ccsid of the body to?
SET OutputRoot.MQRFH2.(MQRFH2.Field)CCSID = 1208;  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jorgego |
Posted: Fri Sep 14, 2007 1:36 am Post subject: |
|
|
Newbie
Joined: 13 Sep 2007 Posts: 6
|
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.
Thank you for your responses
Jorge. |
|
Back to top |
|
 |
|