Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-329

SaajContentHandler shouldn't repeat namespace declarations

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.5.2
    • Component/s: Core
    • Labels:
      None
    • Environment:
      BEA WLS 9.2

      Description

      We have realized some WebServices with PayloadRootAnnotationMethodEndpointMapping and Jaxb2Marshaller. The resulting soap document is valid, but the namespace declarations are repeated on each element. The behavior depends on javax.xml.stream.isRepairingNamespaces implementation in the StaX OutputStream.

      The repetition of the namespace declarations comes from SaajContentHandler.startElement(...). The statements

      for (Iterator iterator = namespaces.keySet().iterator(); iterator.hasNext() {
      String namespacePrefix = (String) iterator.next();
      String namespaceUri = (String) namespaces.get(namespacePrefix);
      child.addNamespaceDeclaration(namespacePrefix, namespaceUri);
      }

      adds the declarations. Now the Sun StaX (sjsxp.jar) removes the needless declarations and all is fine. But the BEA WLS StaX implementation leaves the declarations untouched.

      Through JAXB2 all known namespaces are named on the first element (if there are used or not). So the resulting xml contains 70% namespace declarations and is very big. If there is no reason for the current implementation, please only add namespace declarations of the current element, not the start element.

        Activity

        wuendric Sven W√ľndrich created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Fix Version/s 1.5.1 [ 10917 ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 1.5.1 [ 10917 ]
        Fix Version/s 1.5.2 [ 10966 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing issues in 1.5.2

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing issues in 1.5.2
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        21d 19h 1m 1 Arjen Poutsma 05/May/08 10:28 PM
        Resolved Resolved Closed Closed
        76d 23h 38m 1 Arjen Poutsma 21/Jul/08 10:06 PM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            wuendric Sven W√ľndrich
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: