Axiom
  1. Axiom
  2. AXIOM-408

Namespace repairing performed by StAXOMBuilder is incomplete with default namespaces

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.12
    • Fix Version/s: 1.2.13
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Hudson added a comment -

        Integrated in ws-axiom-trunk #781 (See https://builds.apache.org/job/ws-axiom-trunk/781/)
        AXIOM-408: Fixed an issue in the namespace repairing logic in the builder (that occurs when a namespace declaration of the form xmlns="" is missing).

        veithen :
        Files :

        • /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/BuilderUtil.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java
        • /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderNamespaceRepairing2.java
        Show
        Hudson added a comment - Integrated in ws-axiom-trunk #781 (See https://builds.apache.org/job/ws-axiom-trunk/781/ ) AXIOM-408 : Fixed an issue in the namespace repairing logic in the builder (that occurs when a namespace declaration of the form xmlns="" is missing). veithen : Files : /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/BuilderUtil.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateStAXOMBuilderNamespaceRepairing2.java

          People

          • Assignee:
            Andreas Veithen
            Reporter:
            Andreas Veithen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development