Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XML and illegal characters

843834Jan 29 2004 — edited Feb 2 2004
The big picture:
1. I have legacy data in an Oracle database.
2. I have written some web services to access the data, that work 99%.

3. In some of the data there are characters that cause my web services to break. These characters are the type that get copy/pasted from a Micro$oft Word document.

How do I get this type of data out of my Oracle CLOB as a java.lang.String that can be serialized/deserialized by my web services.

The error that I get is similar to:

deserialization error: deserialization error: XML parsing error: com.sun.xml.rpc.sp.ParseException:16: Illegal XML character: & # x 1 c;

I can't be the first to run into this.

I tried to handle this with the character encoding:
byte[] clob = mediator.retrieveClob().getBytes("Unicode"); //gets clob from Oracle database
result.setDescription(new String(clob,"Unicode")); //sets value for object to be sent via web service
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2004
Added on Jan 29 2004
5 comments
536 views