|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XML Writing Errors have occurred; Unconvertable character; |
« View previous topic :: View next topic » |
Author |
Message
|
mustang |
Posted: Fri Aug 31, 2007 12:26 pm Post subject: XML Writing Errors have occurred; Unconvertable character; |
|
|
Acolyte
Joined: 07 Feb 2006 Posts: 72
|
We use WMB 6.
We receive the above error occasionally when we receive unusual characters (from messages sent by outside business partners). For instance, one character was translated to – by a different tool, and often displays as a dash in other applications. Another example is the section symbol §.
The code it throws an error from is:
CAST(ASBITSTREAM(InputRoot.XMLNSC OPTIONS FolderBitStream) AS CHARACTER CCSID charset ENCODING encoding)
We have tried setting CCSID and ENCODING to what was in the input message, as well as hard coding it (Set charset = 437; Set encoding = 546;).
Is there a way to write the cast statement that will be more resilient? Alternatively, is there a way we can set just that statement in an error trap (like a try/catch in java)? We have tried Declare Handler, but we have been unable to identify when the handler stops catching errors. It seems to extend well beyond the "END" of the procedure it is placed in.
Any assistance would be much appreciated.
Thanks!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
Back to top |
|
 |
mgk |
Posted: Sat Sep 01, 2007 1:43 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
You can use a DEFAULT clause on a CAST in V6 to provide a default if the CAST would otherwise throw an exception.
A handler is in scope for the duration of the function/procedure in which it is declared, and is therefore in scope for all functions/procedures called from the first (unless the second or subsequest procedure declares their own handler block).
Regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 01, 2007 5:51 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@mustang
Using CAST ASBITSTREAM will often give you an error if the CCSID you are using for the output does not support the special character in the input.
May I remind you here that UTF-8 is a multi byte character set where most of the characters are represented on 1 byte but some characters are represented on multiple bytes (like n tilde or copyright mark, paragraph mark etc...)
Some single byte character sets (500, 37) may have a mapping for those characters. 437 as standard does not...
So when transforming the message into a bit stream it is safest to either use CCSID 1208 (UTF-8 ) or CCSID 1200 (UTF-16)
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Mon Sep 03, 2007 3:20 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
If the error says 'XML writing errors have occurred' then I would guess that the initial error is being thrown from the ASBITSTREAM call ( probably at the point where XMLNSC converts the output bit stream to the specified code page ).
If my guess is correct then no amount of fiddling with your CAST statement will fix the problem. I suggest that you remove the CAST and see whether you still get the same error. |
|
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
|
|
|
|