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 2018/03/19 06:34:13 UTC

[camel] branch camel-2.20.x updated: [CAMEL-12364]ensure a SOAP 1.2 enabled camel-cxf consumer endpoint can handle SOAP 1.1 request correctly

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

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


The following commit(s) were added to refs/heads/camel-2.20.x by this push:
     new e4c8e0b  [CAMEL-12364]ensure a SOAP 1.2 enabled camel-cxf consumer endpoint can handle SOAP 1.1 request correctly
e4c8e0b is described below

commit e4c8e0bc3a49e9757f0eea12b20ddfb9392259f3
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Mon Mar 19 12:52:23 2018 +0800

    [CAMEL-12364]ensure a SOAP 1.2 enabled camel-cxf consumer endpoint can handle SOAP 1.1 request correctly
    
    (cherry picked from commit 1b24475bced711c2fb02ee4f0c57ca72861a4f6d)
    (cherry picked from commit d8141a90e6105ae89c9528dab3ede5520d286d2e)
---
 .../java/org/apache/camel/component/cxf/DefaultCxfBinding.java     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
index 9389c92..088ee71 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
@@ -57,6 +57,8 @@ import org.apache.cxf.binding.soap.Soap11;
 import org.apache.cxf.binding.soap.Soap12;
 import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapHeader;
+import org.apache.cxf.binding.soap.SoapMessage;
+import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Endpoint;
@@ -350,6 +352,11 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware
         // create out message
         Endpoint ep = cxfExchange.get(Endpoint.class);
         Message outMessage = ep.getBinding().createMessage();
+        if (cxfExchange.getInMessage() instanceof SoapMessage) { 
+            SoapVersion soapVersion = ((SoapMessage)cxfExchange.getInMessage()).getVersion();
+            ((SoapMessage)outMessage).setVersion(soapVersion);
+        }
+        
         cxfExchange.setOutMessage(outMessage);       
 
         DataFormat dataFormat = camelExchange.getProperty(CxfConstants.DATA_FORMAT_PROPERTY,  

-- 
To stop receiving notification emails like this one, please contact
ffang@apache.org.