|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Invalid character in CDatasection |
« View previous topic :: View next topic » |
Author |
Message
|
WBI_user |
Posted: Tue Nov 20, 2007 8:49 am Post subject: Invalid character in CDatasection |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I am gertting XML message from external client. The XML message contains a CDATASection.
In a previous post, thanks to Kimbert pointing out that invalid characters cannot be inside even the CDATASection.
I have no control on the incoming message and so have no idea why the 0x1c is there. But my job is to find a way to store he CData into the DB. I can remove or replace the invalid character if I have to.
I did a simple test with a flow
MQINPUT - DB
MQINPUT node has the following properties
XMLNS
parsing on demand
none validation
ESQL in DB node
INSERT INTO Database.MSG_LOG (TIMESTAMP, MSG_DATA) VALUES
(Root.XMLNS.LOG_MSG.TIMESTAMP, Root.XMLNS.LOG_MSG.MSG_DATA);
Input message
<?xml version="1.0" encoding="UTF-8"?>
<LOG_MSG>
<TIMESTAMP>2007-11-08 21:13:51.250</TIMESTAMP>
<MSG_DATA><![CDATA[8578 810 687762T 2007-10-16 ]]></MSG_DATA>
</LOG_MSG>
Input message displayed under RFHUTIL (hex display)
00000000 3C3F786D 6C207665 7273696F 6E3D2231
00000016 2E302220 656E636F 64696E67 3D225554
00000032 462D3822 3F3E3C4C 4F475F4D 53473E3C
00000048 54494D45 5354414D 503E3230 30372D31
00000064 312D3038 2032313A 31333A35 312E3235
00000080 303C2F54 494D4553 54414D50 3E3C4D53
00000096 475F4441 54413E3C 215B4344 4154415B
00000112 38353738 20202020 20202020 20202020
00000128 20202020 20202020 20202020 20202020
00000144 20202038 31302020 20202036 38373736
00000160 32542020 20202020 20202020 20202020
00000176 20202020 20202020 20323030 372D3130
00000192 2D313620 20202020 20202020 20202020
00000208 20202020 1C5D5D3E 3C2F4D53 475F4441
00000224 54413E3C 2F4C4F47 5F4D5347 3E
Using a hex editor, I can see the x'1c' just before the ]] as follow:
000000d0:20 20 20 20 1c 5d 5d 3e 3c 2f 4d 53 47 5f 44 41 .]]></MSG_DA
Using debug , right at the output of the MQINPUT it shows
+MQMD
-XMLNS
- LOG_MSG
+TIMESTAMP
MSG_DATA
XML Parsing Errors have occurred
LocalEnvironment
Environment
ExceptionList
It does not create an exception list. It show 'XML Parsing Errors have occurred' instead of the content of MSG_DATA. Data did not get to the DB
Running the user trace, it shows
ParserException BIP5004E: XML parsing error ('Invalid character (Unicode: 0x1C) ') encountered on line 1 column 2096 while parsing element 'MSG_DATA'.
I then use a hex editor to remove the x'1c', it then works.
So one thing I can do is to use ESQL to look for x'1c' and remove or replace it.
But since the exception is right at the MQINPUT, I need some suggestion on how I can use a message flow to do this. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 20, 2007 10:31 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Seems to me that what you have is a CCSID problem.
Somewhere along the line you are moving from CCSID 1208 to a CCSID that does not support the special char ( hence the 1C...) like CCSID 819 or 437...
You need to make sure that the broker knows the CCSID you are parsing and make sure that along the way you never move to a CCSID that cannot render any of the chars in your CDATA section....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 20, 2007 1:29 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I agree with fjb_saper - this may be caused by CCSID conversion problems.
However, you said 'I have no control on the incoming message'. So you need to make clear to the provider of your input message that it is not valid XML. They have therefore broken their side of the interface contract ( presumably they promised to provide an XML message ). |
|
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
|
|
|
|