|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Special Char causing evaluateXPath to fail |
« View previous topic :: View next topic » |
Author |
Message
|
kimbert |
Posted: Fri Aug 01, 2014 12:58 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
ahem.
Code: |
msgAsText.getBytes() |
_________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
Back to top |
|
 |
deepeshk79 |
Posted: Mon Aug 04, 2014 11:44 am Post subject: |
|
|
Apprentice
Joined: 25 Mar 2007 Posts: 45 Location: Los Angeles
|
Sry Kimbert.. didnt get what u said, what is issue with msgAsText.getBytes() ?
Code: |
//Now create outBody again
outBody = outRoot.createElementAsLastChildFromBitstream(msgAsText.getBytes(), parserName, messageName, messageSet, wireFormat, outEncoding, outCcsId, 0);
|
|
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 04, 2014 12:09 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
The issue with msgAsText.getBytes() is that again the interface is not used right. What is the CCSID of the byte array being returned??
Should that not be something like
text.getBytes(barray, "UTF-8") or something similar? The assumption here is the byte array will be returned in UTF-8. Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
deepeshk79 |
Posted: Mon Aug 04, 2014 1:23 pm Post subject: |
|
|
Apprentice
Joined: 25 Mar 2007 Posts: 45 Location: Los Angeles
|
Thanks fjb_saper & kimbert..after posting a reply I realized what was being told this is superb, code is working now - so basically root cause was two things
1) String to bytes - that needs a charset as shown below
Code: |
msgAsText = new String(bytes,charset); |
2) Bytes to string - that needs a charset as shown below
Code: |
msgAsText.getBytes(charset) |
It now works like a charm !!! Once again, thanks guys.. u r all superb !! |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|