This is an automated email from the ASF dual-hosted git repository.
oscerd pushed a commit to branch camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.18.x by this push:
new 36a5088b58be CAMEL-23526: camel-cxf - align Exchange header constant
names with Camel naming convention (#23369)
36a5088b58be is described below
commit 36a5088b58be38317a8f974ffda2a262fa00b4e4
Author: Andrea Cosentino <[email protected]>
AuthorDate: Wed May 20 15:05:38 2026 +0200
CAMEL-23526: camel-cxf - align Exchange header constant names with Camel
naming convention (#23369)
Backport of #23326 onto camel-4.18.x.
Renames the Exchange header string values in CxfConstants (camel-cxf-common,
shared by camel-cxf and camel-cxfrs) from operationName / operationNamespace
to CamelCxfOperationName / CamelCxfOperationNamespace. The Java field names
(OPERATION_NAME, OPERATION_NAMESPACE) are unchanged so routes referencing
the constants symbolically continue to work; routes using the literal string
values must be updated (documented in the 4.18 upgrade guide).
Documents the cxfrs SimpleConsumer dispatch-idiom change and the
cross-transport propagation behaviour change: Camel* headers are filtered at
transport boundaries by design, so routes bridging an external transport
into a cxf: producer must carry the operation through a non-Camel-prefixed
carrier header and map it to CamelCxfOperationName between the transport
from and the cxf: to.
Reported by Claude Code on behalf of Andrea Cosentino
---
.../org/apache/camel/catalog/components/cxf.json | 4 +-
.../org/apache/camel/catalog/components/cxfrs.json | 2 +-
.../component/cxf/common/message/CxfConstants.java | 4 +-
.../apache/camel/component/cxf/jaxrs/cxfrs.json | 2 +-
.../src/main/docs/cxfrs-component.adoc | 2 +-
.../CxfRsConsumerSimpleBindingImplTest.java | 2 +-
.../CxfRsConsumerSimpleBindingTest.java | 2 +-
.../org/apache/camel/component/cxf/jaxws/cxf.json | 4 +-
.../src/main/docs/cxf-component.adoc | 2 +-
.../camel/component/cxf/jaxws/CxfProducer.java | 2 +-
.../CxfRsConsumerSimpleBindingImplTest.java | 2 +-
.../CxfRsConsumerSimpleBindingTest.java | 2 +-
.../cxf/CxfPayloadProviderRouterTest.java | 6 +-
.../ROOT/pages/camel-4x-upgrade-guide-4_18.adoc | 74 ++++++++++++++++++++++
.../endpoint/dsl/CxfEndpointBuilderFactory.java | 12 ++--
.../endpoint/dsl/CxfRsEndpointBuilderFactory.java | 6 +-
.../greeter/JettyRecipientListCxfIssueTest.java | 3 +
.../camel/itest/greeter/JmsToCxfInOutTest.java | 9 ++-
.../itest/greeter/JmsToCxfInOutTest-context.xml | 8 +++
19 files changed, 119 insertions(+), 29 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json
index 630dc2c17bd4..4ecbb030a0e4 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxf.json
@@ -34,8 +34,8 @@
"useGlobalSslContextParameters": { "index": 6, "kind": "property",
"displayName": "Use Global Ssl Context Parameters", "group": "security",
"label": "security", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Enable usage of global SSL context
parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
- "operationNamespace": { "index": 1, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The operation namespace.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE"
},
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName":
"", "group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationNamespace": { "index": 1, "kind": "header",
"displayName": "", "group": "common", "label": "", "required": false,
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired":
false, "secret": false, "description": "The operation namespace.",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE"
},
"CamelDestinationOverrideUrl": { "index": 2, "kind": "header",
"displayName": "", "group": "common", "label": "", "required": false,
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired":
false, "secret": false, "description": "The destination override url",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#DESTINATION_OVERRIDE_URL"
},
"ResponseContext": { "index": 3, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "Map<String,
Object>", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "description": "The response context", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#RESPONSE_CONTEXT" },
"CamelAuthentication": { "index": 4, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType":
"javax.security.auth.Subject", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "description": "The authentication",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json
index 392585a3302a..af9d4a6c04cd 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/cxfrs.json
@@ -33,7 +33,7 @@
"useGlobalSslContextParameters": { "index": 5, "kind": "property",
"displayName": "Use Global Ssl Context Parameters", "group": "security",
"label": "security", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Enable usage of global SSL context
parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName":
"", "group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelAuthentication": { "index": 1, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType":
"javax.security.auth.Subject", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "description": "The authentication",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
"CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The http method to use", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_METHOD" },
"CamelHttpPath": { "index": 3, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The http path", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_PATH" },
diff --git
a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
index 5a258018c4d1..51608da0035b 100644
---
a/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
+++
b/components/camel-cxf/camel-cxf-common/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
@@ -48,9 +48,9 @@ public final class CxfConstants {
public static final String ACCEPT_CONTENT_TYPE =
Message.ACCEPT_CONTENT_TYPE;
@Metadata(description = "The name of the operation.", javaType = "String")
- public static final String OPERATION_NAME = "operationName";
+ public static final String OPERATION_NAME = "CamelCxfOperationName";
@Metadata(description = "The operation namespace.", javaType = "String",
applicableFor = SCHEME_CXF)
- public static final String OPERATION_NAMESPACE = "operationNamespace";
+ public static final String OPERATION_NAMESPACE =
"CamelCxfOperationNamespace";
public static final String SPRING_CONTEXT_ENDPOINT = "bean:";
@Metadata(description = "The destination override url", javaType =
"String", applicableFor = SCHEME_CXF)
public static final String DESTINATION_OVERRIDE_URL =
Exchange.DESTINATION_OVERRIDE_URL;
diff --git
a/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json
b/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json
index 392585a3302a..af9d4a6c04cd 100644
---
a/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json
+++
b/components/camel-cxf/camel-cxf-rest/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxrs/cxfrs.json
@@ -33,7 +33,7 @@
"useGlobalSslContextParameters": { "index": 5, "kind": "property",
"displayName": "Use Global Ssl Context Parameters", "group": "security",
"label": "security", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Enable usage of global SSL context
parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName":
"", "group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
"CamelAuthentication": { "index": 1, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType":
"javax.security.auth.Subject", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "description": "The authentication",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
"CamelHttpMethod": { "index": 2, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The http method to use", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_METHOD" },
"CamelHttpPath": { "index": 3, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The http path", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#HTTP_PATH" },
diff --git
a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
index 144fa10affa0..e5c97f6400b8 100644
--- a/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
+++ b/components/camel-cxf/camel-cxf-rest/src/main/docs/cxfrs-component.adoc
@@ -179,7 +179,7 @@ Serviced by the following route:
[source,java]
--------------------------------------------------------------------------------------------
from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
- .recipientList(simple("direct:${header.operationName}"));
+ .recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:newCustomer")
.log("Request: type=${header.type}, active=${header.active},
customerData=${body}");
diff --git
a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
index 82dfc58da6ab..443eed64a5c7 100644
---
a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
+++
b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
@@ -70,7 +70,7 @@ public class CxfRsConsumerSimpleBindingImplTest extends
CamelTestSupport {
@Override
public void configure() {
from(CXF_RS_ENDPOINT_URI)
-
.recipientList(simple("direct:${header.operationName}"));
+
.recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
@Override
diff --git
a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
index 22c1b87c7a2b..2c5d6674cdc1 100644
---
a/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
+++
b/components/camel-cxf/camel-cxf-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
@@ -85,7 +85,7 @@ public class CxfRsConsumerSimpleBindingTest extends
CamelTestSupport {
return new RouteBuilder() {
public void configure() {
from(CXF_RS_ENDPOINT_URI)
-
.recipientList(simple("direct:${header.operationName}"));
+
.recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
public void process(Exchange exchange) throws Exception {
diff --git
a/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json
b/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json
index 630dc2c17bd4..4ecbb030a0e4 100644
---
a/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json
+++
b/components/camel-cxf/camel-cxf-soap/src/generated/resources/META-INF/org/apache/camel/component/cxf/jaxws/cxf.json
@@ -34,8 +34,8 @@
"useGlobalSslContextParameters": { "index": 6, "kind": "property",
"displayName": "Use Global Ssl Context Parameters", "group": "security",
"label": "security", "required": false, "type": "boolean", "javaType":
"boolean", "deprecated": false, "autowired": false, "secret": false,
"defaultValue": false, "description": "Enable usage of global SSL context
parameters." }
},
"headers": {
- "operationName": { "index": 0, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
- "operationNamespace": { "index": 1, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The operation namespace.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE"
},
+ "CamelCxfOperationName": { "index": 0, "kind": "header", "displayName":
"", "group": "common", "label": "", "required": false, "javaType": "String",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The name of the operation.", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAME" },
+ "CamelCxfOperationNamespace": { "index": 1, "kind": "header",
"displayName": "", "group": "common", "label": "", "required": false,
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired":
false, "secret": false, "description": "The operation namespace.",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#OPERATION_NAMESPACE"
},
"CamelDestinationOverrideUrl": { "index": 2, "kind": "header",
"displayName": "", "group": "common", "label": "", "required": false,
"javaType": "String", "deprecated": false, "deprecationNote": "", "autowired":
false, "secret": false, "description": "The destination override url",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#DESTINATION_OVERRIDE_URL"
},
"ResponseContext": { "index": 3, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType": "Map<String,
Object>", "deprecated": false, "deprecationNote": "", "autowired": false,
"secret": false, "description": "The response context", "constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#RESPONSE_CONTEXT" },
"CamelAuthentication": { "index": 4, "kind": "header", "displayName": "",
"group": "common", "label": "", "required": false, "javaType":
"javax.security.auth.Subject", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "description": "The authentication",
"constantName":
"org.apache.camel.component.cxf.common.message.CxfConstants#AUTHENTICATION" },
diff --git
a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
index 1a33d087de56..b38260c666d1 100644
--- a/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
+++ b/components/camel-cxf/camel-cxf-soap/src/main/docs/cxf-component.adoc
@@ -441,7 +441,7 @@ As an alternative, you can add a message header for it as
demonstrated in https:
You can configure the CXF endpoint with the Spring configuration file
shown below, and you can also embed the endpoint into the `camelContext`
tags. When you are invoking the service endpoint, you can set the
-`operationName` and `operationNamespace` headers to explicitly state
+`CamelCxfOperationName` and `CamelCxfOperationNamespace` headers to explicitly
state
which operation you are calling.
[source,xml]
diff --git
a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java
b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java
index 60ffb26646a3..63595d90da90 100644
---
a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java
+++
b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/CxfProducer.java
@@ -410,7 +410,7 @@ public class CxfProducer extends DefaultAsyncProducer {
* null:
* </p>
* <ul>
- * <li>Using the in message header "operationName".</li>
+ * <li>Using the in message header "CamelCxfOperationName".</li>
* <li>Using the defaultOperationName option value from the
CxfEndpoint.</li>
* <li>Using the first operation which is find from the CxfEndpoint
Operations list.</li>
* <ul>
diff --git
a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
index becba92d8a57..3aceac0080c5 100644
---
a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
+++
b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingImplTest.java
@@ -68,7 +68,7 @@ public class CxfRsConsumerSimpleBindingImplTest extends
CamelTestSupport {
@Override
public void configure() {
from(CXF_RS_ENDPOINT_URI)
-
.recipientList(simple("direct:${header.operationName}"));
+
.recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
@Override
diff --git
a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
index 42e43b8b60fb..1817c88a4b57 100644
---
a/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
+++
b/components/camel-cxf/camel-cxf-spring-rest/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/CxfRsConsumerSimpleBindingTest.java
@@ -84,7 +84,7 @@ public class CxfRsConsumerSimpleBindingTest extends
CamelTestSupport {
return new RouteBuilder() {
public void configure() {
from(CXF_RS_ENDPOINT_URI)
-
.recipientList(simple("direct:${header.operationName}"));
+
.recipientList(simple("direct:${header.CamelCxfOperationName}"));
from("direct:getCustomer").process(new Processor() {
public void process(Exchange exchange) throws Exception {
diff --git
a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java
b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java
index 7b8ada2c688a..870881e0b9ed 100644
---
a/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java
+++
b/components/camel-cxf/camel-cxf-spring-soap/src/test/java/org/apache/camel/component/cxf/CxfPayloadProviderRouterTest.java
@@ -22,6 +22,7 @@ import jakarta.xml.ws.Service;
import javax.xml.namespace.QName;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.cxf.common.message.CxfConstants;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
@@ -68,8 +69,9 @@ public class CxfPayloadProviderRouterTest extends
AbstractCXFGreeterRouterTest {
return new RouteBuilder() {
public void configure() {
from("cxf:bean:routerEndpoint?synchronous=true&dataFormat=PAYLOAD")
- .setHeader("operationNamespace",
constant("http://camel.apache.org/cxf/jaxws/dispatch"))
- .setHeader("operationName", constant("Invoke"))
+ .setHeader(CxfConstants.OPERATION_NAMESPACE,
+
constant("http://camel.apache.org/cxf/jaxws/dispatch"))
+ .setHeader(CxfConstants.OPERATION_NAME,
constant("Invoke"))
.to("cxf:bean:serviceEndpoint?synchronous=true&dataFormat=PAYLOAD");
}
};
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc
index 3ceaf1fdbf17..b6908cecaed8 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_18.adoc
@@ -391,3 +391,77 @@ outbound regex. Headers starting with `Camel` / `camel`
(case-insensitive), `bre
component with the rest of the Camel component catalog. Routes that relied on
receiving these
header names on inbound SNS messages can supply a custom
`headerFilterStrategy` to restore the
previous behaviour.
+
+=== camel-cxf
+
+The Exchange header constants in `CxfConstants` (module `camel-cxf-common`,
shared
+by `camel-cxf` and `camel-cxfrs`) have been renamed to follow the Camel naming
+convention used across the rest of the component catalog. The Java field names
are
+unchanged; only the header string values have changed:
+
+[options="header"]
+|===
+| Constant | Previous value | New value
+| `CxfConstants.OPERATION_NAME` | `operationName` | `CamelCxfOperationName`
+| `CxfConstants.OPERATION_NAMESPACE` | `operationNamespace` |
`CamelCxfOperationNamespace`
+|===
+
+Routes that reference the constant symbolically (for example
+`setHeader(CxfConstants.OPERATION_NAME, ...)`) continue to work without
changes.
+Routes that set the header by its literal string value (for example
+`setHeader("operationName", ...)`) must be updated to use the new value
+(`setHeader("CamelCxfOperationName", ...)`).
+
+In particular, the documented `cxfrs` `SimpleConsumer` dispatch idiom that
routes
+on the operation name by its literal header name must be updated:
+
+[source,java]
+----
+// before
+from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
+ .recipientList(simple("direct:${header.operationName}"));
+
+// after
+from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
+ .recipientList(simple("direct:${header.CamelCxfOperationName}"));
+----
+
+==== Behaviour change: cross-transport propagation of the operation header
+
+Because the renamed header value now begins with `Camel`, it is filtered by the
+standard transport `HeaderFilterStrategy` (`JmsHeaderFilterStrategy`,
+`HttpHeaderFilterStrategy`, etc.) when crossing a transport boundary, by design
+— `Camel*` headers are framework-internal and are not propagated over the wire.
+
+Routes that bridge an external transport (JMS, HTTP, ...) into a `cxf:`
producer
+and select the SOAP operation from a header supplied by the sender must
+therefore carry the operation in a non-`Camel`-prefixed application header and
+map it to `CxfConstants.OPERATION_NAME` (`CamelCxfOperationName`) in the route
+between the transport `from` and the `cxf:` `to`:
+
+[source,xml]
+----
+<!-- before -->
+<route>
+ <from uri="jms:queue:bridge.cxf"/>
+ <to uri="cxf://bean:serviceEndpoint"/>
+</route>
+<!-- caller sets the header keyed by the pre-rename value:
+ setHeader("operationName", "greetMe") -->
+
+<!-- after -->
+<route>
+ <from uri="jms:queue:bridge.cxf"/>
+ <setHeader name="CamelCxfOperationName">
+ <simple>${header.operationName}</simple>
+ </setHeader>
+ <to uri="cxf://bean:serviceEndpoint"/>
+</route>
+<!-- caller sets a non-Camel-prefixed application carrier header (any name
+ that is not stripped by the transport HeaderFilterStrategy works);
+ the route restores the CXF operation header after the transport hop. -->
+----
+
+The same pattern applies to HTTP-based bridges (`platform-http`/`jetty`/`netty
+-http`/`http` -> `cxf:`) and any other transport whose default
+`HeaderFilterStrategy` filters `Camel*` headers.
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
index d7955cecfcfb..ddad0322eb9e 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfEndpointBuilderFactory.java
@@ -2653,10 +2653,10 @@ public interface CxfEndpointBuilderFactory {
*
* Group: common
*
- * @return the name of the header {@code operationName}.
+ * @return the name of the header {@code CxfOperationName}.
*/
- public String operationName() {
- return "operationName";
+ public String cxfOperationName() {
+ return "CamelCxfOperationName";
}
/**
* The operation namespace.
@@ -2665,10 +2665,10 @@ public interface CxfEndpointBuilderFactory {
*
* Group: common
*
- * @return the name of the header {@code operationNamespace}.
+ * @return the name of the header {@code CxfOperationNamespace}.
*/
- public String operationNamespace() {
- return "operationNamespace";
+ public String cxfOperationNamespace() {
+ return "CamelCxfOperationNamespace";
}
/**
* The destination override url.
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
index 28a6350b88ff..30cb6a142775 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CxfRsEndpointBuilderFactory.java
@@ -2171,10 +2171,10 @@ public interface CxfRsEndpointBuilderFactory {
*
* Group: common
*
- * @return the name of the header {@code operationName}.
+ * @return the name of the header {@code CxfOperationName}.
*/
- public String operationName() {
- return "operationName";
+ public String cxfOperationName() {
+ return "CamelCxfOperationName";
}
/**
* The authentication.
diff --git
a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
index 842582b36b00..c9fa542aabbb 100644
---
a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
+++
b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JettyRecipientListCxfIssueTest.java
@@ -57,6 +57,9 @@ public class JettyRecipientListCxfIssueTest extends
CamelSpringTestSupport {
// send a message to jetty
Exchange out =
template.request("http://0.0.0.0:{{RecipientListCxfTest.port3}}/myapp",
exchange -> {
+ // Use the non-Camel-prefixed carrier header convention so it
survives
+ // the HTTP transport boundary; the receiver maps it to the renamed
+ // CxfConstants.OPERATION_NAME value before any cxf: call.
exchange.getIn().setHeader("operationName", "greetMe");
exchange.getIn().setBody(request);
});
diff --git
a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java
b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java
index 585bc1060b71..73358bc6b177 100644
---
a/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java
+++
b/tests/camel-itest/src/test/java/org/apache/camel/itest/greeter/JmsToCxfInOutTest.java
@@ -17,7 +17,6 @@
package org.apache.camel.itest.greeter;
import org.apache.camel.ProducerTemplate;
-import org.apache.camel.component.cxf.common.message.CxfConstants;
import org.apache.camel.itest.utils.extensions.JmsServiceExtension;
import org.apache.camel.test.AvailablePortFinder;
import org.apache.camel.test.spring.junit5.CamelSpringTest;
@@ -49,12 +48,16 @@ public class JmsToCxfInOutTest {
void testJmsToCxfInOut() {
assertNotNull(template);
- String out = template.requestBodyAndHeader("jms:queue:bridge.cxf",
"Willem", CxfConstants.OPERATION_NAME, "greetMe",
+ // The CXF operation header value now begins with "Camel" and is
therefore
+ // filtered by JmsHeaderFilterStrategy at the transport boundary. Send
the
+ // operation as a non-Camel-prefixed carrier header; the route maps it
to
+ // CxfConstants.OPERATION_NAME between the JMS from and the cxf: to.
+ String out = template.requestBodyAndHeader("jms:queue:bridge.cxf",
"Willem", "operationName", "greetMe",
String.class);
assertEquals("Hello Willem", out);
// call for the other operation
- out = template.requestBodyAndHeader("jms:queue:bridge.cxf", new
Object[0], CxfConstants.OPERATION_NAME, "sayHi",
+ out = template.requestBodyAndHeader("jms:queue:bridge.cxf", new
Object[0], "operationName", "sayHi",
String.class);
assertEquals("Bonjour", out);
}
diff --git
a/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml
b/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml
index 72c51505e7a4..e392f778c3bb 100644
---
a/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml
+++
b/tests/camel-itest/src/test/resources/org/apache/camel/itest/greeter/JmsToCxfInOutTest-context.xml
@@ -68,6 +68,14 @@
<route>
<from uri="jms:queue:bridge.cxf"/>
<to uri="log:jms"/>
+ <!-- The CXF operation header (CxfConstants.OPERATION_NAME =
+ "CamelCxfOperationName") is filtered at the JMS boundary by
+ JmsHeaderFilterStrategy, which strips "Camel*" headers by
design.
+ Restore it from the application-level carrier header set by
the
+ sender. See the 4.21 upgrade guide. -->
+ <setHeader name="CamelCxfOperationName">
+ <simple>${header.operationName}</simple>
+ </setHeader>
<to uri="cxf://bean:serviceEndpoint"/>
</route>