This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch 3.27.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git


The following commit(s) were added to refs/heads/3.27.x by this push:
     new 15da2f5d [camel-4.14] Fix #8691 CXF SOAP example for CAMEL-23526 
header name changes
15da2f5d is described below

commit 15da2f5db88b16118c4c3061e2b1b0496d6409a0
Author: JiriOndrusek <[email protected]>
AuthorDate: Wed Jul 1 14:51:11 2026 +0200

    [camel-4.14] Fix #8691 CXF SOAP example for CAMEL-23526 header name changes
    
    Cherry-pick of 95362c03 adapted for c4.14.8 branch structure:
    - operationName header references now use CxfConstants.OPERATION_NAME
    - PojoCxfProducerRouteBuilder changes skipped (no producer route on this 
branch)
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
---
 .../org/acme/cxf/soap/pojo/MyPojoRouteBuilder.java |  4 +++-
 .../org/acme/cxf/soap/utils/CxfServerUtils.java    | 26 ++++++++++++++++++++++
 .../org/acme/cxf/soap/wsdl/MyWsdlRouteBuilder.java |  4 +++-
 3 files changed, 32 insertions(+), 2 deletions(-)

diff --git 
a/cxf-soap/src/main/java/org/acme/cxf/soap/pojo/MyPojoRouteBuilder.java 
b/cxf-soap/src/main/java/org/acme/cxf/soap/pojo/MyPojoRouteBuilder.java
index 37b26acf..49345ecb 100644
--- a/cxf-soap/src/main/java/org/acme/cxf/soap/pojo/MyPojoRouteBuilder.java
+++ b/cxf-soap/src/main/java/org/acme/cxf/soap/pojo/MyPojoRouteBuilder.java
@@ -23,6 +23,8 @@ import org.acme.cxf.soap.pojo.service.ContactService;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.cxf.jaxws.CxfEndpoint;
 
+import static org.acme.cxf.soap.utils.CxfServerUtils.OPERATION_NAME_HEADER;
+
 /**
  * This class demonstrate how to expose a SOAP endpoint starting from java 
classes
  */
@@ -43,6 +45,6 @@ public class MyPojoRouteBuilder extends RouteBuilder {
     @Override
     public void configure() throws Exception {
         from("cxf:bean:contact")
-                
.recipientList(simple("bean:inMemoryContactService?method=${header.operationName}"));
+                .recipientList(simple("bean:inMemoryContactService?method=" + 
OPERATION_NAME_HEADER));
     }
 }
diff --git a/cxf-soap/src/main/java/org/acme/cxf/soap/utils/CxfServerUtils.java 
b/cxf-soap/src/main/java/org/acme/cxf/soap/utils/CxfServerUtils.java
new file mode 100644
index 00000000..623fc543
--- /dev/null
+++ b/cxf-soap/src/main/java/org/acme/cxf/soap/utils/CxfServerUtils.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.acme.cxf.soap.utils;
+
+import org.apache.camel.component.cxf.common.message.CxfConstants;
+
+public final class CxfServerUtils {
+    public static final String OPERATION_NAME_HEADER = 
"${header.%s}".formatted(CxfConstants.OPERATION_NAME);
+
+    private CxfServerUtils() {
+    }
+}
diff --git 
a/cxf-soap/src/main/java/org/acme/cxf/soap/wsdl/MyWsdlRouteBuilder.java 
b/cxf-soap/src/main/java/org/acme/cxf/soap/wsdl/MyWsdlRouteBuilder.java
index 2a28ab49..7659de2e 100644
--- a/cxf-soap/src/main/java/org/acme/cxf/soap/wsdl/MyWsdlRouteBuilder.java
+++ b/cxf-soap/src/main/java/org/acme/cxf/soap/wsdl/MyWsdlRouteBuilder.java
@@ -31,6 +31,8 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.cxf.jaxws.CxfEndpoint;
 import org.apache.cxf.message.MessageContentsList;
 
+import static org.acme.cxf.soap.utils.CxfServerUtils.OPERATION_NAME_HEADER;
+
 /**
  * This class demonstrate how to expose a SOAP endpoint starting from a wsdl, 
using the
  * quarkus-maven-plugin:generate-code
@@ -63,7 +65,7 @@ public class MyWsdlRouteBuilder extends RouteBuilder {
     public void configure() throws Exception {
         // CustomerService is generated with 
quarkus-maven-plugin:generate-code during the build
         from("cxf:bean:customer")
-                .recipientList(simple("direct:${header.operationName}"));
+                .recipientList(simple("direct:" + OPERATION_NAME_HEADER));
 
         from("direct:getCustomersByName").process(exchange -> {
             String name = exchange.getIn().getBody(String.class);

Reply via email to