Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.2
-
None
-
None
-
Axis 1.2, Tomcat 5.0, Eclipse 3
Description
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/>
- RESULTS **************************************
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- END OF RESULTS ********************************
-
-
-
-
-
-
-
-
-
-
-
-
-
The problem may be related to more classes than SOAPFault but i didn't have time to investigate.