Daniel Kulp created CAMEL-10578:
-----------------------------------

             Summary: Default namespaces defined on SOAPEnvelope cause problems 
with CXF PAYLOAD mode
                 Key: CAMEL-10578
                 URL: https://issues.apache.org/jira/browse/CAMEL-10578
             Project: Camel
          Issue Type: Bug
          Components: camel-cxf
    Affects Versions: 2.18.1, 2.17.4, 2.16.4
            Reporter: Daniel Kulp
            Assignee: Daniel Kulp
             Fix For: 2.16.5, 2.17.5, 2.18.2



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)
{code}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]
{code}

2) Secure message:
{code}
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]
{code}

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




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to