|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQ Response message has garbled characters for spaces |
« View previous topic :: View next topic » |
Author |
Message
|
starki78 |
Posted: Fri Dec 07, 2012 1:47 am Post subject: MQ Response message has garbled characters for spaces |
|
|
Acolyte
Joined: 24 Sep 2007 Posts: 53
|
Hello,
We have the following issue and I hope that someone has a great idea:-)
When using the following Code we get the Correct-Resonse as below:
Code: |
gmo.options = MQC.MQGMO_NO_SYNCPOINT; // Set no sync point
gmo.options = MQC.MQGMO_CONVERT; // Handles ASCII/EBCDIC
gmo.options = MQC.MQGMO_WAIT;// Wait until message arrives
mqQueue.get(outMessage, gmo);
b = new byte[outMessage.getMessageLength()];
System.out.println("Message Length is --"+b);
sXMLString = outMessage.readStringOfByteLength(b.length);
|
<?xml version='1.0'?><asg><header><op>eCSF></op>version>2.0</version><data>81385 001eCSF 0004333300000000000000001348037380 </data></header><msg><cec>HZBVPRD Z11020
00001 00043333 00000000134000000000 0000000000000000000000000000 test hrd XN1 007777COC 000000000000000000000000000000000000 .00 </cec></msg></asg>
But this is failing:
Code: |
b = new byte[message.getMessageLength()];
outMessage.readFully (b);
String stringPayload = new String(b, 0, b.length, "ISO-8859-1"); |
The CCSID from the arriving message is 819
What is failing is that with second option we see garbled characters instead of spaces:
<data>31385 001eCSFññöÄÙðõ
0004000000000043911öóðøñ </data></header><msg>L nLa nLa ¢ nLa ¢ n
My question is: Did anybody see such kind of symbols and what might be the cause?
Thanks for any pointer |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 07, 2012 2:46 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You need to add the MQGMO options together!
Also if you are nice to MQ, use FAIL_IF_QUIESCING as well. |
|
Back to top |
|
 |
McueMart |
Posted: Fri Dec 07, 2012 4:51 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Or if you want to look like a real bit modifying hippy, you can 'or' the options together '|' - which has the same effect! |
|
Back to top |
|
 |
starki78 |
Posted: Fri Dec 07, 2012 7:30 am Post subject: |
|
|
Acolyte
Joined: 24 Sep 2007 Posts: 53
|
thanks for your feedback.
I did not recognize this error, however it makes no difference in the reported testresults |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 07, 2012 8:59 am Post subject: Re: MQ Response message has garbled characters for spaces |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
starki78 wrote: |
But this is failing:
Code: |
b = new byte[message.getMessageLength()];
outMessage.readFully (b);
String stringPayload = new String(b, 0, b.length, "ISO-8859-1"); |
The CCSID from the arriving message is 819
What is failing is that with second option we see garbled characters instead of spaces:
<data>31385 001eCSFññöÄÙðõ
0004000000000043911öóðøñ </data></header><msg>L nLa nLa ¢ nLa ¢ n
My question is: Did anybody see such kind of symbols and what might be the cause?
Thanks for any pointer |
Why are you surprised that the the 2nd method as shown here is failing?
You are not asking for a string but a byte array... which would as I figure it bypass the conversion you asked for? Check if you are possibly getting all control stuff (chars. bytes etc...) in EBCDIC ?
You know it is a text message so use the first method. Working as designed...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|