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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.23.2, 2.22.4, 3.0.0
    • camel-cxf
    • None
    • Patch Available
    • Unknown

    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).

      Attachments

        1. ReproducerException.log
          5 kB
          Jochen Riedlinger

        Issue Links

          Activity

            People

              ffang Freeman Yue Fang
              j_ri Jochen Riedlinger
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: