You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by as...@apache.org on 2015/08/26 11:53:20 UTC

[1/2] cxf git commit: [CXF-6198] Adding property for getting SOAPFault for HTTP error code 400

Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes a1b0028a8 -> bf03cdc51


[CXF-6198] Adding property for getting SOAPFault for HTTP error code 400


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1f36ca22
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1f36ca22
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1f36ca22

Branch: refs/heads/3.0.x-fixes
Commit: 1f36ca2212cea46a1a842b4770c7614fbb093c84
Parents: a1b0028
Author: Alessio Soldano <as...@redhat.com>
Authored: Wed Aug 26 09:38:46 2015 +0200
Committer: Alessio Soldano <as...@redhat.com>
Committed: Wed Aug 26 11:51:09 2015 +0200

----------------------------------------------------------------------
 .../apache/cxf/transport/http/HTTPConduit.java  | 35 +++++++++++++-------
 1 file changed, 23 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1f36ca22/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
index 737221b..44d9faf 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
@@ -1557,28 +1557,39 @@ public abstract class HTTPConduit
             return false;
         }
 
-        protected void handleResponseInternal() throws IOException {
+        protected int doProcessResponseCode() throws IOException {
             Exchange exchange = outMessage.getExchange();
-            int responseCode = getResponseCode();
-            if (responseCode == -1) {
+            int rc = getResponseCode();
+            if (rc == -1) {
                 LOG.warning("HTTP Response code appears to be corrupted");
             }
             if (exchange != null) {
-                exchange.put(Message.RESPONSE_CODE, responseCode);
+                exchange.put(Message.RESPONSE_CODE, rc);
             }
                        
-            // This property should be set in case the exceptions should not be handled here
-            // For example jax rs uses this
-            boolean noExceptions = MessageUtils.isTrue(outMessage.getContextualProperty(
-                "org.apache.cxf.transport.no_io_exceptions"));
+            // "org.apache.cxf.transport.no_io_exceptions" property should be set in case the exceptions
+            // should not be handled here; for example jax rs uses this
             
-            if (responseCode >= 400 && responseCode != 500 && !noExceptions) {
-                
-                if (responseCode == 404 || responseCode == 503) {
+            // "org.apache.cxf.transport.process_fault_on_http_400" property should be set in case a
+            // soap fault because of a HTTP 400 should be returned back to the client (SOAP 1.2 spec)
+
+            if (rc >= 400 && rc != 500
+                && !MessageUtils.isTrue(outMessage.getContextualProperty("org.apache.cxf.transport.no_io_exceptions"))
+                && (rc > 400 || !MessageUtils.isTrue(outMessage
+                    .getContextualProperty("org.apache.cxf.transport.process_fault_on_http_400")))) {
+
+                if (rc == 404 || rc == 503) {
                     exchange.put("org.apache.cxf.transport.service_not_available", true);
                 }
-                throw new HTTPException(responseCode, getResponseMessage(), url.toURL());
+
+                throw new HTTPException(rc, getResponseMessage(), url.toURL());
             }
+            return rc;
+        }
+        
+        protected void handleResponseInternal() throws IOException {
+            Exchange exchange = outMessage.getExchange();
+            int responseCode = doProcessResponseCode();
 
             InputStream in = null;
             // oneway or decoupled twoway calls may expect HTTP 202 with no content


[2/2] cxf git commit: Recording .gitmergeinfo Changes

Posted by as...@apache.org.
Recording .gitmergeinfo Changes


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/bf03cdc5
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/bf03cdc5
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/bf03cdc5

Branch: refs/heads/3.0.x-fixes
Commit: bf03cdc511752d6c6722776119075f4410976e13
Parents: 1f36ca2
Author: Alessio Soldano <as...@redhat.com>
Authored: Wed Aug 26 11:50:23 2015 +0200
Committer: Alessio Soldano <as...@redhat.com>
Committed: Wed Aug 26 11:52:34 2015 +0200

----------------------------------------------------------------------
 .gitmergeinfo | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bf03cdc5/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index 13eae83..8180c00 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -471,6 +471,7 @@ M 25d02a2a04b8552faf88fd0879423618f15be8ee
 M 27c1bb5a19ea70ef1befccff22d72f1656247b0d
 M 2895b7b052e6c96d192abf39d472737b54fcd9c2
 M 2b4fe9966c46457177f6412525c57c64d07dbe69
+M 2bbdbdab92befd79e5083cf7a298f6a931a2e76e
 M 2cfcbbc2ce20118e06ca3ef11f08f6f106181055
 M 2d3ac551c8614516cbbf288195d2a99cadb79659
 M 2e701bcd1cabcc7ae4cb69346eacb8ab278e2827