Author |
Message
|
angka |
Posted: Thu Feb 19, 2009 7:01 pm Post subject: XML parsing error using ResetContentDescriptor node |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
I encountered XML parsing error ("Invalid character (Unicode:0x1A)") error while using a ResetContentDescriptor node to parse a MQ message body(MQSTR) to xml.
Below is the detail on how the message is generated.
1) User input data using web broswer and the data is generated into xml document.
2) It was then deserialize to string and insert into MSSQL server as varchar.
3) A .net application picks up from the database and insert the data(payload in string) into MQ body. CCSID set to 437 and Encoding to 546.
4) The message is put to remote queue and sends over to another QM and the Message Broker picks up.
5) And it throws the message to SYSTEM.DEAD.LETTER.QUEUE with the above mentioned error.
Both the QM is using Windows server 2003. The web application is using asp.net.
Think there is some invalid character with the user input. But I can't seem to find the invalid character. Somehow rfhutil can view the message and parsed it to xml(maybe just for viewing). I looked at the character in hex but none seems to be a problem.
I tried to google for "invalid character unicode 0x1A" but still not very sure what is wrong.
Anyone knows the solution to this??
Thank you |
|
Back to top |
|
 |
MQEnthu |
Posted: Thu Feb 19, 2009 10:10 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
In XML V1.0, the Unicode 0X'1A' (substitute) is not a valid character.. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
angka |
Posted: Thu Feb 19, 2009 10:12 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
But how to type 0x1A as the data is input by user?
Thanks |
|
Back to top |
|
 |
MQEnthu |
Posted: Thu Feb 19, 2009 10:56 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
This is not a WMB error, this is normal XML parsing error. You can ask sending system to not to send this invalid character... _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
angka |
Posted: Thu Feb 19, 2009 11:11 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
I realised there is a 0x7F character (Del char) but how does the user enter this? or is it because user enter same valid character but after deserialize and insert to database, the char changes? e.g. when char "<" in xml tag deserialize to string, it becomes something else.
Thanks. |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Feb 20, 2009 4:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
angka wrote: |
But how to type 0x1A as the data is input by user? |
In Unicode, and ASCII-based character sets, 0x1A is the 'SUBSTITUTE' character. The functions that convert a string from one character set to another often use the SUBSTITUTE character to replace any characters that aren't defined in the target character set.
When converting between ASCII-based character sets, non-ASCII characters (hex >= 80) are vulnerable to substitution, and even moreso when converting with the wrong CCSID. |
|
Back to top |
|
 |
angka |
Posted: Sat Feb 21, 2009 9:52 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
But all the systems involve are using Windows OS 2000 or 2003. so for the .net application to set the CCSID to 437 shld not be any problem right?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Feb 22, 2009 9:10 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
angka wrote: |
Hi,
But all the systems involve are using Windows OS 2000 or 2003. so for the .net application to set the CCSID to 437 shld not be any problem right?
Thanks |
Remember that the native form for .Net is Unicode (CCSID 1200).
So if you want to use ccsid 437 you need to convert your content before writing it to the message.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
angka |
Posted: Sun Feb 22, 2009 6:34 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
fjb_saper wrote: |
angka wrote: |
Hi,
But all the systems involve are using Windows OS 2000 or 2003. so for the .net application to set the CCSID to 437 shld not be any problem right?
Thanks |
Remember that the native form for .Net is Unicode (CCSID 1200).
So if you want to use ccsid 437 you need to convert your content before writing it to the message.  |
Hi,
Are you suspecting tt the user input some character which is represented by 2 bytes(CCSID 1200) but when the .net application converts it to 1 byte(CCSID 437), it become 0x1A(SUB Char)?
If so how do i convert the content all to 1 byte before writing to the message?
Thanks |
|
Back to top |
|
 |
angka |
Posted: Sun Feb 22, 2009 7:31 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
fjb_saper wrote: |
angka wrote: |
Hi,
But all the systems involve are using Windows OS 2000 or 2003. so for the .net application to set the CCSID to 437 shld not be any problem right?
Thanks |
Remember that the native form for .Net is Unicode (CCSID 1200).
So if you want to use ccsid 437 you need to convert your content before writing it to the message.  |
Hi,
Are you suspecting tt the user input some character which is represented by 2 bytes(CCSID 1200) but when the .net application converts it to 1 byte(CCSID 437), it become 0x1A(SUB Char)?
If so how do i convert the content all to 1 byte before writing to the message?
Thanks |
|
Back to top |
|
 |
smdavies99 |
Posted: Sun Feb 22, 2009 11:04 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
Quote: |
If so how do i convert the content all to 1 byte before writing to the message? |
You don't.... Broker does it for you.
When the output message is built at the output node it is formatted according to how you have setup the CCSID. That tells the builder to format in say Ebcidic, Kanji, ISO8859-1 or whatever.
If you get that right then the output will be in the correct Characterset. _________________ 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 |
|
 |
angka |
Posted: Sun Feb 22, 2009 11:40 pm Post subject: |
|
|
Chevalier
Joined: 20 Sep 2005 Posts: 406
|
Hi,
The problem is the message is converted to CCSID 437 before it is send over to the broker QM. And then the message body is already corrupted.
Thanks |
|
Back to top |
|
 |
|