Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10578

Default namespaces defined on SOAPEnvelope cause problems with CXF PAYLOAD mode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.16.4, 2.17.4, 2.18.1
    • Fix Version/s: 2.16.5, 2.17.5, 2.18.2
    • Component/s: camel-cxf
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      With a doc/literal endpoint using PAYLOAD mode, if a client sends a request where the child element of the Body uses a default namespace and that namespace is defined on the soap envelope or soap body (and not the element itself), you either get an exception of:

      1) (insecure message, no WSS4J processing)

      org.xml.sax.SAXParseException: Element or attribute do not match QName production: QName::=(NCName':')?NCName. 
          at org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:610)[75:org.apache.camel.camel-core:2.16.3]
          at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:137)[75:org.apache.camel.camel-core:2.16.3]
      

      2) Secure message:

      org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
          at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.checkNamespaceWF(CoreDocumentImpl.java:2535)[:1.8.0_66]
          at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImpl.java:93)[:1.8.0_66]
          at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.<init>(AttrNSImpl.java:78)[:1.8.0_66]
          at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttributeNS(CoreDocumentImpl.java:2164)[:1.8.0_66]
          at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.createAttributeNS(SOAPDocumentImpl.java:186)[162:org.apache.servicemix.bundles.saaj-impl:1.3.23.2]
          at com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl.createAttribute(SOAPDocumentImpl.java:153)[162:org.apache.servicemix.bundles.saaj-impl:1.3.23.2]
          at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttribute(ElementImpl.java:498)[:1.8.0_66]
          at org.apache.camel.component.cxf.DefaultCxfBinding.addNamespace(DefaultCxfBinding.java:764)[76:org.apache.camel.camel-cxf:2.16.3]
      

      both are due to camel-cxf/DefaultCxfBinding.addNamespaces not properly adding default namespace attributes to the DOM.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: