[ http://issues.apache.org/jira/browse/WSCOMMONS-22?page=all ]

Nick Gallardo updated WSCOMMONS-22:
-----------------------------------

    Attachment: SOAPEnvTest.java

Test case for exposing the problem.

> (SOAP1.1 - LLOM) SOAPEnvelopeImpl.getHeader() creates incorrect element 
> ordering
> --------------------------------------------------------------------------------
>
>          Key: WSCOMMONS-22
>          URL: http://issues.apache.org/jira/browse/WSCOMMONS-22
>      Project: WS-Commons
>         Type: Bug

>   Components: AXIOM
>  Environment: Axiom 1.0 - Should happen in all environments
>     Reporter: Nick Gallardo
>  Attachments: SOAPEnvTest.java
>
> There is a minor bug in the LLOM SOAP API whereby, calling 
> SOAPEnvelopeImpl.getHeader() will result in an incorrect ordering of the OM 
> tree.  Specifically, the SOAPHeader.nextSibling property will point back to 
> itself rather than pointing to the SOAPBody.  Here's the code snippet to 
> re-create it.
> I've create a simple test case that should be pretty straight forward.
> To fix the bug, you just have to remove the line marked like this 
> (<remove>foo</remove>) below.  Before this point, the SOAPHeader has already 
> been added as a child and is correctly pointing at the SOAPBody as its 
> sibling.  
>     public SOAPHeader getHeader() throws OMException {
>         SOAPHeader header =
>                 (SOAPHeader) getFirstChildWithName(
>                         new QName(SOAPConstants.HEADER_LOCAL_NAME));
>         if (builder == null && header == null) {
>             inferFactory();
>             header = ((SOAPFactory) factory).createSOAPHeader(this);
>             <remove>addChild(header);</remove>
>         }
>         return header;
>     }
> I've made this change and re-run the tests with no failures.

-- 
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

Reply via email to