Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-10390

Regression - Namespaces defined on the SOAP envelope get lost in PAYLOAD mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • fuse-7.4-GA
    • fuse-7.0, fuse-7.1, fuse-7.2
    • Camel, CXF
    • None
    • % %
    • Hide

      The reproducer is based on the "camel-example-cxf-proxy" example.
      Here it is:

      https://github.com/jochenr/camel/tree/Reproducer-CAMEL-13357/examples/camel-example-cxf-proxy

      To test it, please send the XML from the following file(s) via Soap-UI to the service:
      https://github.com/jochenr/camel/blob/Reproducer-CAMEL-13357/examples/camel-example-cxf-proxy/src/test/resources/non-working-request.xml
      https://github.com/jochenr/camel/blob/Reproducer-CAMEL-13357/examples/camel-example-cxf-proxy/src/test/resources/working-request.xml
      1. does not work, while 2. works fine.
      If you compare the requests you see that 1. has the "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"" namespace in the Envelope, while 2. defines it within the body.

      If you change the option "allowStreaming=true" to false, you can see the request 1. also works.

      In my opinion 1. should also work, if streaming is enabled.

      Show
      The reproducer is based on the "camel-example-cxf-proxy" example. Here it is: https://github.com/jochenr/camel/tree/Reproducer-CAMEL-13357/examples/camel-example-cxf-proxy To test it, please send the XML from the following file(s) via Soap-UI to the service: https://github.com/jochenr/camel/blob/Reproducer-CAMEL-13357/examples/camel-example-cxf-proxy/src/test/resources/non-working-request.xml https://github.com/jochenr/camel/blob/Reproducer-CAMEL-13357/examples/camel-example-cxf-proxy/src/test/resources/working-request.xml 1. does not work, while 2. works fine. If you compare the requests you see that 1. has the "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"" namespace in the Envelope, while 2. defines it within the body. If you change the option "allowStreaming=true" to false, you can see the request 1. also works. In my opinion 1. should also work, if streaming is enabled.
    • Fuse 7.4 Sprint 45 - Dev #1

    Description

      If a request message is send to a CXF consumer or a response is returned to the CXF provider that contains namespace definions at the SOAP envelope and the Camel-CXF endpoint is configured in PAYLOAD mode the namespace definition gets lost unless streaming is disabled.
      If the resulting CxfPayload is then converted e.g. to String that String will contain invalid XML (because some namespace definition is missing).
      For non-streaming mode (system property org.apache.camel.component.cxf.streaming is set to false) there are special precautions met to set these envelope namespaces on the first DOM element of the payload but this coding is missing for StAX.
      The messages in question look like that:

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <soap:Body>
      <ns2:getTokenResponse xmlns:ns2="http://camel.apache.org/cxf/namespace">
      <return xsi:type="xs:string">Return Value</return>
      </ns2:getTokenResponse>
      </soap:Body>
      </soap:Envelope>
      

      If the CxfPayload is converted to String it will lack the definition for the xsi namespace prefix (and further XML parsing will fail).

      upstream Jira : https://issues.apache.org/jira/browse/CAMEL-13357

      Attachments

        Activity

          People

            yfang@redhat.com Freeman(Yue) Fang
            rhn-support-kkakarla kodandaRamu kakarla
            Viliam Kasala Viliam Kasala
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: