You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ff...@apache.org on 2023/06/14 16:00:24 UTC

[camel] branch main updated: [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message

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

ffang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 668ae0aa365 [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message
668ae0aa365 is described below

commit 668ae0aa36551d16fdfce004fbbe41a6a5851a2c
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Wed Jun 14 12:00:12 2023 -0400

    [CAMEL-19455]Ensure REQUEST_CONTEXT & RESPONSE_CONTEXT headers are Map when populating CXF Message from Camel Message
---
 .../apache/camel/component/cxf/jaxws/DefaultCxfBinding.java   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java
index d199eefb6e4..13eb2c68b85 100644
--- a/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java
+++ b/components/camel-cxf/camel-cxf-soap/src/main/java/org/apache/camel/component/cxf/jaxws/DefaultCxfBinding.java
@@ -596,7 +596,11 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware
             String contextKey) {
 
         // extract from header
-        Map<String, ?> context = (Map<String, ?>) camelHeaders.get(contextKey);
+        Map<String, ?> context = null;
+        if (camelHeaders.get(contextKey) instanceof Map) {
+            context = (Map<String, ?>) camelHeaders.get(contextKey);
+        }
+
         if (context != null) {
             cxfContext.putAll(context);
             if (LOG.isTraceEnabled()) {
@@ -608,7 +612,10 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware
         }
 
         // extract from exchange property
-        context = (Map<String, ?>) camelExchange.getProperty(contextKey);
+        if (camelExchange.getProperty(contextKey) instanceof Map) {
+            context = (Map<String, ?>) camelExchange.getProperty(contextKey);
+        }
+
         if (context != null) {
             cxfContext.putAll(context);
             if (LOG.isTraceEnabled()) {