You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jeff Saremi (JIRA)" <ax...@ws.apache.org> on 2005/09/02 16:30:12 UTC
[jira] Created: (AXIS-2207) SOAPFault has no children! Causes serialization to be incorrect.
SOAPFault has no children! Causes serialization to be incorrect.
----------------------------------------------------------------
Key: AXIS-2207
URL: http://issues.apache.org/jira/browse/AXIS-2207
Project: Apache Axis
Type: Bug
Components: SAAJ
Versions: 1.2
Environment: Axis 1.2, Tomcat 5.0, Eclipse 3
Reporter: Jeff Saremi
If you decide to serialize org.apache.axis.message.SOAPFault by ways of using other methods than the serializationContext and/or toString() method you will not be able to get it serialize correctly. For instance, try using XMLUtils.ElementToStream on a SOAPFault. The result is completely different than when you use fault.toString().
I think its related to the fact that under the fault no children show up!
Here's a quick test:
************* CODE *****************************
private static final String XML_STRING = "<soapenv:Fault xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><faultcode xmlns:ns1=\"http://xml.apache.org/axis/\">ns1:SomeFaultCode</faultcode><faultstring>Some text for the fault</faultstring><faultactor/><detail/></soapenv:Fault>";
public void testSOAPFault() throws Exception {
Document doc = XMLUtils.newDocument(
new ByteArrayInputStream(XML_STRING.getBytes()) );
SOAPFault fault = new SOAPFault(
AxisFault.makeFault(new Exception("something went wrong")));
ByteArrayOutputStream bout = new ByteArrayOutputStream();
XMLUtils.ElementToStream(fault, bout);
System.out.println("fault.getChildNodes().getLength() = " +
fault.getChildNodes().getLength());
System.out.println(bout.toString());
}
********************* END OF CODE *****************************
*************** RESULTS **************************************
fault.getChildNodes().getLength() = 0
<null/>
*************** END OF RESULTS ********************************
The problem may be related to more classes than SOAPFault but i didn't have time to investigate.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira