Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4520

XMLStreamException about namespace has not been bound to a prefix with other stax implemenation

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.2
    • Fix Version/s: 2.4.10, 2.5.6, 2.6.3
    • Component/s: Core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      While using CXF with other stax implementation, I got the exception below
      javax.xml.stream.XMLStreamException: The namespace URI "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" has not been bound to a prefix.

      With the investigation, I found that, it is because that, StaxUtils does not write those namespace before other attributes. e.g. for the element below
      wsp:Policy wsu:Id="ImageServiceImplServiceSoapBinding_WSAM_Addressing_Policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">-<wsam:Addressing wsp:Optional="true"><wsp:Policy/></wsam:Addressing></wsp:Policy>

      The writeElement method will write the attribute wsu:Id first, which causes issue as the prefix wsu has not be declared. Seems that woodstox is more tolerant for those things.

        Attachments

        1. CXF-4520.patch
          3 kB
          Haihong Xu

          Activity

            People

            • Assignee:
              dkulp Daniel Kulp
              Reporter:
              xuhaihong Haihong Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: