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 » "UTF-8" (Unicode) message wrong after adding MQRFH

Post new topic  Reply to topic
 "UTF-8" (Unicode) message wrong after adding MQRFH « View previous topic :: View next topic » 
Author Message
jorgego
PostPosted: Thu Sep 13, 2007 9:56 am    Post subject: "UTF-8" (Unicode) message wrong after adding MQRFH Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Sep 13, 2007 10:01 am    Post subject: Reply with quote

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
View user's profile Send private message
jorgego
PostPosted: Thu Sep 13, 2007 6:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 13, 2007 7:34 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
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
View user's profile Send private message Send e-mail
jorgego
PostPosted: Fri Sep 14, 2007 1:36 am    Post subject: Reply with quote

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
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 » "UTF-8" (Unicode) message wrong after adding MQRFH
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.