You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2014/12/23 23:11:51 UTC

cxf git commit: [CXF-6127] Check cause for SOAPFaultException to populate subcodes and locale

Repository: cxf
Updated Branches:
  refs/heads/master a815cd9b5 -> b4bdea3b2


[CXF-6127] Check cause for SOAPFaultException to populate subcodes and locale


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

Branch: refs/heads/master
Commit: b4bdea3b2ae0932d6344a1a483b7ebfa425eedf6
Parents: a815cd9
Author: Kyle Lape <ky...@redhat.com>
Authored: Mon Dec 1 14:34:23 2014 -0800
Committer: Akitoshi Yoshida <ay...@apache.org>
Committed: Tue Dec 23 23:08:21 2014 +0100

----------------------------------------------------------------------
 .../cxf/jaxws/interceptors/WebFaultOutInterceptor.java    | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b4bdea3b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
index 882e9d2..4d2a014 100644
--- a/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
+++ b/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java
@@ -92,8 +92,14 @@ public class WebFaultOutInterceptor extends FaultOutInterceptor {
             return;
         }
         try {
-            if (f.getCause().getClass().equals(SOAPFaultException.class)) {
-                SOAPFaultException sf = (SOAPFaultException) (f.getCause());
+            Throwable thr = f.getCause();
+            SOAPFaultException sf = null;
+            if (thr instanceof SOAPFaultException) {
+                sf = (SOAPFaultException)thr;
+            } else if (thr.getCause() instanceof SOAPFaultException) {
+                sf = (SOAPFaultException)thr.getCause();
+            }
+            if (sf != null) {
                 if (f instanceof SoapFault) {
                     for (Iterator<QName> it = CastUtils.cast(sf.getFault().getFaultSubcodes()); it.hasNext();) {
                         ((SoapFault) f).addSubCode(it.next());