Problem Statement - The writeString method is converting some international characters to 0x3F i.e. ?
For Example - Hex characters like A0, A1, etc. are getting converted to 3F
Please advice!
Code snippet -
mqMessage.encoding = MQConstants.MQENC_NATIVE;// 546
mqMessage.format = Constants.MQ_MESSAGE_FORMAT;
// mqMessage.characterSet = 437; //
mqMessage.writeString(RFH_STRING);
mqMessage.writeInt(2);
StringBuffer rfh2 = new StringBuffer(Constants.USR_TAG_START);
rfh2.append(messageVO.getRFH2()).append(Constants.USR_TAG_END);
StringBuffer padUsrRFH2 = usrPad(rfh2);
LoggingUtil.logMessage(log, "padUsrRFH2.toString()-->"
+ padUsrRFH2.toString(), LOG_LEVEL_DEBUG);
LoggingUtil.logMessage(log, "padUsrRFH2.length()-->"
+ padUsrRFH2.length(), LOG_LEVEL_DEBUG);
mqMessage.writeInt(40 + padUsrRFH2.length()); // struct
mqMessage.writeInt(MQConstants.MQENC_NATIVE); // encoding
mqMessage.writeInt(MQConstants.MQCCSI_INHERIT); // CodedCharSetId
mqMessage.writeString(" "); // format
mqMessage.writeInt(0); // flags
mqMessage.writeInt(1208); // valueCCID
mqMessage.writeInt(padUsrRFH2.length());
mqMessage.writeString(padUsrRFH2.toString());
Thanks,
FYI, I also used mqMessage.characterSet = 1208; but that added 2 more hex characters.
Well, looking at your code, your format is wrong... it should be something like MQC.MQFMT_RFH2... you'd have to check it against the new Constants class... and
by the way why are you building the RFH from scratch
? Use XMS as it comes with the product... or the V7 style properties as you are using V7 classes... (Constants.)...
And your message CCSID is not what you expect. Verify the meaning of
_________________
MQ & Broker admin
While I fully understand your desire not to make unnecessary changes, there comes a point where you just have accept the passing of time. I offer into evidence the introduction of message properties in WMQv7 which heralds the end of the RFH2 as we know it.
At some point you're going to need to review this code. It might be better to do it sooner rather than later; imagine if you open the "What's New in WMQv8" and discover that the RFH2 has been removed? Isn't that a change you'd sooner make when the migration clock isn't ticking?
_________________
Honesty is the best policy.
Insanity is the best defence.
MQSeries.net Forum Index
»
IBM MQ API Support
»
MQ V7 writeString converting Hex chars to 3F (Important)
Jump to: