Namespace repairing performed by StAXOMBuilder is incomplete with default 
namespaces
------------------------------------------------------------------------------------

                 Key: AXIOM-408
                 URL: https://issues.apache.org/jira/browse/AXIOM-408
             Project: Axiom
          Issue Type: Bug
    Affects Versions: 1.2.12
            Reporter: Andreas Veithen
            Assignee: Andreas Veithen
            Priority: Minor
             Fix For: 1.2.13


The issue can be reproduced with the following code that uses Axis2's BeanUtil 
class (which creates an OMElement from a custom XMLStreamReader implementation):

OMElement element = BeanUtil.getOMElement(new QName("urn:test", "test"), new 
Object[]{ new DataHandler("test", "text/plain") }, null, false, null);
System.out.println(element);
System.out.println(element.getFirstElement().getAllDeclaredNamespaces().hasNext());

The output is:

<test xmlns="urn:test"><arg0 xmlns="">dGVzdA==</arg0></test>
false

This shows that xmlns="" is added by the serializer, but is not present in the 
object model. This is incorrect because the builder is also expected to perform 
namespace repairing, i.e. it should have added the corresponding namespace 
declaration when the object model was built.

This is likely to cause issues in Rampart, in particular if DOOM is enabled. 
The reason is that the object model is passed to WSS4J/Santuario which expects 
the namespace information to be complete. Missing namespace declarations are 
likely to cause incorrect signature calculations.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to