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 » Special Char causing evaluateXPath to fail

Post new topic  Reply to topic Goto page Previous  1, 2
 Special Char causing evaluateXPath to fail « View previous topic :: View next topic » 
Author Message
kimbert
PostPosted: Fri Aug 01, 2014 12:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
deepeshk79
PostPosted: Mon Aug 04, 2014 11:44 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
fjb_saper
PostPosted: Mon Aug 04, 2014 12:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
deepeshk79
PostPosted: Mon Aug 04, 2014 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Special Char causing evaluateXPath to fail
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.