Hi all,

I'm writing a web service that hits a legacy Oracle database, the problem is that some of the data is bad and contains illegal characters (0x11 & 0x12). Obviously we need to get the client to clean their data in the long term, but I was wondering if in the short term there was a way I could configure xFire to write the XML out to a file as well as the ws client, or otherwise encode the returned data so that these weird characters didn't cause fatal errors in woodstox, like the one below...

I can manually code sanitising methods, but the problem is that at the moment I have no idea where the bad data is, as this only gets hit when in the middle of returning a list of 1000's of beans, each which about 1k of text data. I need some way of tracking down where the invalid chars are so I can sanitise them.

Any ideas?

org.codehaus.xfire.XFireRuntimeException: Error writing document.. Nested exception is com.ctc.wstx.exc.WstxIOException: Invalid white space character (0x12) in text to output
com.ctc.wstx.exc.WstxIOException: Invalid white space character (0x12) in text to output
    at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:511)
    at org.codehaus.xfire.aegis.stax.ElementWriter.writeValue(ElementWriter.java:138)
    at org.codehaus.xfire.aegis.type.basic.StringType.writeObject(StringType.java:26)
    at org.codehaus.xfire.aegis.type.basic.BeanType.writeObject(BeanType.java:392)
    at org.codehaus.xfire.aegis.type.basic.ArrayType.writeValue(ArrayType.java:298)
    at org.codehaus.xfire.aegis.type.basic.ArrayType.writeObject(ArrayType.java:210)
    at org.codehaus.xfire.aegis.AegisBindingProvider.writeParameter(AegisBindingProvider.java:229)
    at org.codehaus.xfire.service.binding.AbstractBinding.writeParameter(AbstractBinding.java:273)
    at org.codehaus.xfire.service.binding.WrappedBinding.writeMessage(WrappedBinding.java:90)
    at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:80)
    at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:56)
    at org.codehaus.xfire.transport.http.XFireServletChannel.sendViaServlet(XFireServletChannel.java:87)
    at org.codehaus.xfire.transport.http.XFireServletChannel.send(XFireServletChannel.java:44)
    at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.service.binding.PostInvocationHandler.invoke(PostInvocationHandler.java:36)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoint.java:64)
    at org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.java:38)
    at org.codehaus.xfire.transport.http.XFireServletController.invoke(XFireServletController.java:304)
    at org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:129)
    at org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: Invalid white space character (0x12) in text to output
    at com.ctc.wstx.sw.XmlWriter.throwInvalidChar(XmlWriter.java:545)
    at com.ctc.wstx.sw.BufferingXmlWriter.writeCharacters(BufferingXmlWriter.java:531)
    at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:509)
    ... 35 more

--

Matthew Kerle
IT Consultant
SRA Information Technology

Canberra
Ground Floor, 40 Brisbane Avenue
BARTON  ACT  2600

Office:    +61 2 6273 6122
Fax:         +61 2 6273 6155
Mobile:  +61404 096 863
Email:   
[EMAIL PROTECTED]
Web:    
www.sra.com.au
--------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email

Reply via email to