ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (Created) (JIRA)" <>
Subject [jira] [Created] (AXIOM-392) Inconsistent behavior with respect to order of SOAPFault child elements
Date Thu, 13 Oct 2011 21:03:12 GMT
Inconsistent behavior with respect to order of SOAPFault child elements

                 Key: AXIOM-392
             Project: Axiom
          Issue Type: Bug
          Components: LLOM
    Affects Versions: 1.2.12
            Reporter: Andreas Veithen
            Priority: Minor

SOAPFaultImpl#internalSerialize contains logic to reorder the child elements to satisfy the
requirements of SOAP 1.2 (which explicitly requires the child elements of a SOAP fault to
appear in a specific order). This is useful for programmatically created SOAP faults because
the application code doesn't need to take care of the order in which setCode, setReason, etc.
are called. However, the reordering only works with some serialization methods. In particular,
the child elements are not reordered when the SOAP message is serialized using a pull parser.

This can be shown using the following code:

SOAPFactory factory = OMAbstractFactory.getSOAP12Factory();
SOAPFault fault = factory.createSOAPFault();
SOAPFaultReason reason = factory.createSOAPFaultReason();
reason.setText("Some reason");
SOAPFaultCode code = factory.createSOAPFaultCode();
code.setText(new QName(factory.getNamespace().getNamespaceURI(), "Server"));
System.out.println("Using serialize:");
System.out.println("Using pull parser:");
XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(System.out);
new StreamingOMSerializer().serialize(fault.getXMLStreamReader(), writer);

The output is:

Using serialize:
<soapenv:Fault xmlns:soapenv=""><soapenv:Code>soapenv:Server</soapenv:Code><soapenv:Reason>Some
Using pull parser:
<soapenv:Fault xmlns:soapenv=""><soapenv:Reason>Some

The reordering only occurs in the first case.

Ideally, Axiom should take care of the order of child elements in the setCode, setReason,
etc. methods and then just serialize the object model as is.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message