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 » General IBM MQ Support » MQ Response message has garbled characters for spaces

Post new topic  Reply to topic
 MQ Response message has garbled characters for spaces « View previous topic :: View next topic » 
Author Message
starki78
PostPosted: Fri Dec 07, 2012 1:47 am    Post subject: MQ Response message has garbled characters for spaces Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Fri Dec 07, 2012 2:46 am    Post subject: Reply with quote

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
View user's profile Send private message
McueMart
PostPosted: Fri Dec 07, 2012 4:51 am    Post subject: Reply with quote

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
View user's profile Send private message
starki78
PostPosted: Fri Dec 07, 2012 7:30 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Fri Dec 07, 2012 8:59 am    Post subject: Re: MQ Response message has garbled characters for spaces Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » MQ Response message has garbled characters for spaces
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.