Federico Mariani created CAMEL-27062:
----------------------------------------

             Summary: camel-cxf - the producer ignores the former operationName 
header without a warning and invokes another operation
                 Key: CAMEL-27062
                 URL: https://issues.apache.org/jira/browse/CAMEL-27062
             Project: Camel
          Issue Type: Bug
          Components: camel-cxf
            Reporter: Federico Mariani


Since CAMEL-23526 the cxf producer selects the operation from the 
{{CamelCxfOperationName}} and {{CamelCxfOperationNamespace}} headers. A route 
that still sets the former {{operationName}} header gets no error and no WARN: 
the producer logs at DEBUG only and invokes the first operation that CXF 
returns for the service. CXF keeps the operations in a hash map, so this is not 
the first operation of the WSDL (for the {{Greeter}} test service it is 
{{testDocLitFault}}). The {{operationName}} header is also sent to the service 
as an HTTP header, because {{CxfHeaderFilterStrategy}} now filters only the new 
names.

{code:java}
from("direct:start")
    .setHeader("operationName", constant("greetMe")) // former name
    .setBody(constant(List.of("Willem")))
    
.to("cxf://http://localhost:9000/SoapPort?serviceClass=org.apache.hello_world_soap_http.Greeter";);
// invokes testDocLitFault, and the service receives an operationName HTTP 
header
{code}

The same happens, without the former header, for any service with more than one 
operation when neither {{CamelCxfOperationName}} nor {{defaultOperationName}} 
is set.

When the operation is not found, the error still names the former headers and 
does not list the operations of the service:
{noformat}
Can't find the BindingOperationInfo with operation name 
{http://wrong/ns}greetMe. Please check the message headers of operationName and 
operationNamespace.
{noformat}

Expected:
* a WARN, logged once per producer, when {{operationName}} or 
{{operationNamespace}} is set without its replacement, naming the new headers;
* a WARN, logged once per producer, when no header and no option selects the 
operation of a service with more than one operation;
* {{CxfHeaderFilterStrategy}} filters the former names again, as it did before 
the rename;
* the error names {{CamelCxfOperationName}}, {{CamelCxfOperationNamespace}} and 
the {{defaultOperationName}}/{{defaultOperationNamespace}} options, and lists 
the operations of the service.

The producer keeps ignoring the former headers: the rename is not reverted.

_Claude Code on behalf of Federico Mariani_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to