1 Reply Latest reply on Feb 15, 2006 9:09 AM by thomas.diesler

    Returning NULL via webservice from a POJO?

    escher9694

      I'm attempting to expose a simple bean with ws4ee. I'm using JBoss 4.0.3SP1 and jwsdp-2.0. ws-compile gave me a few issues, but I got it to deploy and serve wsdl files just fine. The problem is when I call the (doc/literal) webservice from an axis client, I get the following exception:

      2006-02-13 14:25:31,367 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
      java.lang.IllegalArgumentException: The char '0x0' in 'java.io.IOException: java.lang.IllegalArgumentException: The char '0x0' in '' is not a valid XML character.' is not a valid XML character.
      at org.jboss.axis.components.encoding.AbstractXMLEncoder.encode(Abstract
      XMLEncoder.java:206)
      at org.jboss.axis.utils.XMLUtils.xmlEncodeString(XMLUtils.java:97)
      at org.jboss.axis.AxisFault.dumpToString(AxisFault.java:327)
      at org.jboss.axis.AxisFault.printStackTrace(AxisFault.java:782)
      <full stack trace deleted for brevity>

      I looked at what should have been returned in a debugger and saw one String containing null characters. I could manually handle this condition for every String returned, but is there no way to pass this as binary data?

      I hesitate to modify these returned bean classes since they are generated code!