[ 
https://issues.apache.org/jira/browse/CAMEL-7921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14734689#comment-14734689
 ] 

Ton Swieb commented on CAMEL-7921:
----------------------------------

Hi [~ffang],

Thanks for looking into this.

Beside from any WSDL conventions I believe the WSDL is valid and is WS-I 
compliant. When using a valid WSDL I would expect one of the following:
* A valid SOAP implementation is generated.
* An excpetion is thrown stating that a SOAP implementation cannot be generated 
due to missing properties.

Generating a SOAP implementation which is relying on naming conventions in the 
WSDL does not sounds like a very good plan to me. It would require me to either 
always set the servicename attribute explicitly to be on the safe side or 
modify the WSDL to adhere to the naming convention. In case of a missing 
servicename I think it would be better for the Camel Producer to fail fast 
instead of trying to make the best of it.

> The soapAction HTTP header is not correctly set when running the CXF client 
> in POJO mode using Camel
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-7921
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7921
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.12.3, 2.12.4, 2.13.2, 2.14.0
>            Reporter: Ton Swieb
>         Attachments: soapActionTest.zip
>
>
> 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:
> {code}
> @WebService(targetNamespace = "http://finalist.nl/ai/";, name = 
> "ICamelCxfTestService")
> {code}
> and the definition of the service name in the WSDL:
> {code}
> <wsdl:service name="CamelCxfTestService">
> {code}



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

Reply via email to