ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <>
Subject [jira] [Created] (AXIOM-430) Inconsistent serialization of SOAPEnvelope
Date Sun, 01 Jul 2012 10:43:51 GMT
Andreas Veithen created AXIOM-430:

             Summary: Inconsistent serialization of SOAPEnvelope
                 Key: AXIOM-430
             Project: Axiom
          Issue Type: Bug
          Components: DOOM, LLOM
    Affects Versions: 1.2.13
            Reporter: Andreas Veithen
            Priority: Minor

The SOAPEnvelopeImpl#internalSerialize method contains code that skips the serialization of
the SOAP header if it is empty. Presumably this code is there because SOAPFactory#getDefaultEnvelope()
always creates a SOAP header, but one doesn't want that header to appear in the output if
there are no header blocks. However, this only works when the SOAPEnvelope is serialized to
an XMLStreamWriter, OutputStream or Writer. The header is still present in the sequence of
events produced by getXMLStreamReader or getSAXSource. This can be shown using the following
piece of code:

        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope envelope = factory.getDefaultEnvelope();
        factory.createOMElement(new QName("urn:test", "test", "p"), envelope.getBody());
new StreamResult(System.out));

The output is: 

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=""><soapenv:Body><p:test
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=""><soapenv:Header/><soapenv:Body><p:test

In addition to that, SOAPEnvelopeImpl#internalSerialize also skips serialization of whitespace
and comments.

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