cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject [cxf] 02/03: [CXF-8062]be able to set HTTP return code even it's 4xx
Date Tue, 02 Jul 2019 18:57:13 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit f6f5786ce1c19b400e0426765be469366f5a5f8f
Author: Freeman Fang <freeman.fang@gmail.com>
AuthorDate: Tue Jul 2 14:55:04 2019 -0400

    [CXF-8062]be able to set HTTP return code even it's 4xx
    
    (cherry picked from commit 55fff5e59e1cc1015507842e0177d7b083ea4795)
---
 core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
index eb2df49..3b4c38a 100644
--- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
+++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
@@ -38,6 +38,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.handler.MessageContext;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
@@ -539,6 +540,10 @@ public class ClientImpl
             }
             return processResult(message, exchange, oi, resContext);
         } finally {
+            //ensure ResponseContext has HTTP RESPONSE CODE
+            Integer responseCode = (Integer)exchange.get(Message.RESPONSE_CODE);
+            resContext.put(MessageContext.HTTP_RESPONSE_CODE, responseCode);
+            resContext.put(org.apache.cxf.message.Message.RESPONSE_CODE, responseCode);
             setResponseContext(resContext);
             if (origLoader != null) {
                 origLoader.reset();


Mime
View raw message