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

The soapAction HTTP header is not correctly set when running the CXF client in POJO mode using Camel



    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.12.3, 2.12.4, 2.13.2, 2.14.0
    • 2.16.0, 2.14.4, 2.15.4
    • camel-cxf
    • None
    • Unknown


      The soapAction HTTP header is not correctly set when running the CXF client in POJO mode using Camel.

      The root cause seems to be that the service name from the generated service class differs from the service name in the WSDL.

      For me it is unclear if this should be an issue with the cxf-codegen-plugin or with the Camel CXF component. When running the CXF client without Camel then the soapAction HTTP header is correctly set and the issue does not occur. So that's why I first report the bug with Camel.

      Possible workarounds I found are:
      1) Explicitly specifying the correct serviceName as CXF endpoint attribute.
      2) Explicitly setting the soapAction header in the Camel route prior to calling the CXF endpoint.

      Both workarounds are not desirable, because they are easily forgotten and CXF does not throw an exception when you do. According to the basic profile v1.0 the soapAction HTTP header must match the value in the WSDL and receiving SOAP servers may throw a SOAP Fault if it doesn't. Some SOAP servers do throw an exception when the soapAction HTTP header is invalid. Resulting in communication failures between some SOAP client/server combinations.

      I created a test project to verify the above behaviour with the following tests:
      1) CXF in PAYLOAD with Camel. => OK
      2) CXF in POJO mode without Camel => OK
      3) CXF in POJO mode with Camel => NOT OK
      4) CXF in POJO mode with service name set => OK
      5) CXF in POJO mode with soapAction set => OK

      I run the test project with multiple combinations of Camel and CXF. The following combinations I have tried:
      1) Camel 2.12.3 and CXF 2.7.10 (Apache Servicemix 5.0.0 setup)
      2) Camel 2.12.4 and CXF 2.7.11 (Apache Servicemix 5.0.5 setup)
      3) Camel 2.13.2 and CXF 2.7.11 (Apache Servicemix 5.1.3 and 5.3.0 setup)
      4) Camel 2.14.0 and CXF 3.0.1

      In the example project the mismatch occurs between an annotation in the generated service class:

      @WebService(targetNamespace = "http://finalist.nl/ai/", name = "ICamelCxfTestService")

      and the definition of the service name in the WSDL:

      <wsdl:service name="CamelCxfTestService">


        1. soapActionTest.zip
          7 kB
          Ton Swieb



            ffang Freeman Yue Fang
            tonswieb Ton Swieb
            0 Vote for this issue
            5 Start watching this issue