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 character Problem in WMB

Post new topic  Reply to topic Goto page 1, 2  Next
 Special character Problem in WMB « View previous topic :: View next topic » 
Author Message
ein
PostPosted: Tue Apr 27, 2010 11:43 pm    Post subject: Special character Problem in WMB Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

Hello ALL,

I have problem with my exception handling.

In my exception handling flow i need to generate a messae in XML format with all info like exception time, exception type , Node name and flow name and so on and put it in MQ Q.

Coming my problem, In the Last xml tag the exception message flow has place the original content.

For example

<Exception>
<NODE></NODE>
<FLOW NAME></FLOWNAME>
<CONTENT> Orginal Message </CONTENT>

</Exception>

When I am placing the message in the CONTENT TAG I used the below code

SET OutputRoot.XMLNS.Exception.CONTENT = CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.MQMD.CharacterCodeSetID ENCODING InputRoot.MQMD.Encoding);

Some times the above statement is fails for some messages and went to BACK OUT Q.

But I want to avoid this situvation in exception handling.

Can any one suggest me , what universal CCSID and ENCODING I have to use here to avoid failing.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Apr 27, 2010 11:53 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Why not read the message as a BLOB in the MQInput Node and before you parse it, copy it into the Environment. It is the BLOB domain already.

Something like
Code:

MQInputNode-->ComputeNode-->TryCatch-->RCD etc

_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
ein
PostPosted: Wed Apr 28, 2010 12:10 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

I didn't clearly what you given, here i am provding what exactly i am doing.

Mqinput Node --->WTX NODE---> MqOutput Node

The catch terminal of the MQinput is connected to my Exception handling Flow.

The domain of the MQInput is BLOB. So when it comes to Exception handling flow the domain is also a blob.So I take it as BLOB and CASTING it TO CHAR.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 28, 2010 1:19 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
In the Last xml tag the exception message flow has place the original content.
What happens when the original content is not well-formed XML?
Back to top
View user's profile Send private message
ein
PostPosted: Wed Apr 28, 2010 2:55 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

Hi kimbert,

It say XML parsing error occured and went to BOQ.
Back to top
View user's profile Send private message
kimbert
PostPosted: Wed Apr 28, 2010 5:30 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
It say XML parsing error occured and went to BOQ.
Exactly. That's why it is normal to encode the faulty message in some way. The most common options are:
- CDATA (doesn't protect against bad characters, though )
- hexBinary encoding
- base64Binary encoding

CDATA has the advantage that the CDATA tags automatically get removed by any receiving XML parser. For hexBinary/base64Binary the receiving application will need to decode it ( not difficult ).
Back to top
View user's profile Send private message
ein
PostPosted: Wed Apr 28, 2010 10:56 pm    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

I tried to use base 64 encoding. Now it's passing the data to Q with encoded format.
Like
<Exception>
<FLowname> character</flowName>
<Content> BLOB[which is not understable by support team] </Content>
</Exception>

Then Contenet it showing hexa binary format. Which should not understable by support team. So next compute node I use base64 decode .so it reurns BLOB again.

Is ther any way to make it readble.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Apr 29, 2010 12:15 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

You are caught in a bit of a Catch-22 situation here.

As I see it, if you use CDATA then messages with bad XML will not get parsed but the result is human readable.
So you use a BLOB and even bad XML messages will be sent out but the result is not human readable.

I've solved this before by using the Zipnode support pack. This results in a BLOB but the contents are human readable. The only drawback is the AFAIK, it does not work (toolkit) on V7 at the moment.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
ein
PostPosted: Thu Apr 29, 2010 1:34 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

Without a zipnode can't we achive?
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Apr 29, 2010 5:30 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
Then Contenet it showing hexa binary format. Which should not understable by support team. So next compute node I use base64 decode .so it reurns BLOB again.
You could CAST the BLOB to CHARACTER ( using the correct CCSID). Of course, that will recreate the original badly-formed XML, so you'd better be sure not to send the resulting XML doc to an XML parser after the CAST.
Back to top
View user's profile Send private message
ein
PostPosted: Thu Apr 29, 2010 6:27 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

Hello All,

I could have reslove this issue by using base64 encoding and decoding with CDATA.

Now the message seems what i am expected.
Thanks every One
Back to top
View user's profile Send private message
kimbert
PostPosted: Thu Apr 29, 2010 8:02 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Would you mind explaining in a bit more detail? What exactly are you doing with the failure message now?
Back to top
View user's profile Send private message
ein
PostPosted: Fri Apr 30, 2010 12:44 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

First I am encdoing with base64

SET OutputRoot.XMLNS.Exception.Content = base64Encoding(InputRoot.BLOB.BLOB);

On SeconCompute Node I am decoding with Base64Decode and assigned this CDATA.

SET OutputRoot.XMLNS.Exception.Content.(XMLNSC.CDATA)Content=base64Decode(InputRoot.XMNS.Exception.Content);

Please let me know if you need more info
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Apr 30, 2010 1:16 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

I may be missing the point here, but it looks as if you could achieve exactly the same result by encoding it as CDATA in the first Compute node.
If CDATA meets the requirements then don't bother with the redundant conversion to base64 and back again.
If you're concerned that the original message might contain bad characters then find a way to make the base64 readable *after* it has been sent to the support team.
Back to top
View user's profile Send private message
ein
PostPosted: Fri Apr 30, 2010 3:22 am    Post subject: Reply with quote

Centurion

Joined: 14 Mar 2009
Posts: 108

Hi Kimbert,

I tried usnig CDATA in first Compute Node. But its again failed sent to BOQ.


ITs say XML Parsing errors occured.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Special character Problem in WMB
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.