Title: org.xml.sax.SAXParseException: Illegal XML character
Some additional information about this one.
1.  It's working now.  woo-hoo!
2.  It seems to have been tied to Java strings created from a fixed length buffer
3.  That fixed length buffer was populated by an RPC to an AS/400 (so gawd knows what *stuff* was actually in the buffer).
4.  The String objects seemed to work fine in Java (they even went across the wire in EJB calls).
5.  The String objects seemed to serialize fine inside the axis web service.
6.  The xml-ified String objects did NOT seem to deserialize very well :(
7.  The illegal characters (and I was able to generate a couple of subtly different errors by moving code around -- omitting some fields, etc.) were all fixed by .trim() the strings before stuffing them into my value object for the return trip from the web service.
 
Which leads me to one last question...  Is this all a shortcoming in the XML/SAX parser or expected behavior when shipping bad data across the web-service-wire (it *DID* work for the EJB call)?
 
--- bhw
-----Original Message-----
From: Brian Ward [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 29, 2002 2:06 PM
To: '[EMAIL PROTECTED]'
Subject: org.xml.sax.SAXParseException: Illegal XML character

I'm encountering a deserialization error.  I have some strings (which contain some some xml-unfriendly characters) that I am trying to return from an axis deployed web service.  The service itself seems to be fine, but I'm encountering errors in the Java client (using all the same axis jars) when the data arrives.  Particularly, I'm seeing

     [java] org.xml.sax.SAXParseException: Illegal XML character:  �.
     [java]     at org.apache.axis.AxisFault.makeFault(AxisFault.java:120)
     [java]     at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:551)
     [java]     at org.apache.axis.Message.getSOAPEnvelope(Message.java:377)
     [java]     at org.apache.axis.client.Call.invokeEngine(Call.java:2132)
     [java]     at org.apache.axis.client.Call.invoke(Call.java:2102)
     [java]     at org.apache.axis.client.Call.invoke(Call.java:1851)
     [java]     at org.apache.axis.client.Call.invoke(Call.java:1777)
     [java]     at org.apache.axis.client.Call.invoke(Call.java:1315)
     [java]     at generated.PolkSoapBindingStub.vinDecode(Unknown Source)
     [java]     at PolkClient.main(Unknown Source)
     [java] Caused by: org.xml.sax.SAXParseException: Illegal XML character:  �.
     [java]     at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
     [java]     at org.apache.crimson.parser.InputEntity.parsedContent(InputEntity.java:593)
     [java]     at org.apache.crimson.parser.Parser2.content(Parser2.java:1826)
     [java]     at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
     [java]     at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
     [java]     at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
     [java]     at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
     [java]     at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
     [java]     at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
     [java]     at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
     [java]     at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
     [java]     at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
     [java]     at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
     [java]     at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
     [java]     at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:232)
     [java]     at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:546)
     [java]     ... 8 more

I think this is a result of an ampersand in the Java string (prior to serialization), but that's just a guess.

Does anyone have an idea of what may be wrong?

--- bhw

Reply via email to