cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [4/6] cxf git commit: CXF-7453 check subCodes only in case of SOAP 1.2 This closes #296
Date Fri, 28 Jul 2017 16:21:01 GMT
CXF-7453 check subCodes only in case of SOAP 1.2
This closes #296


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

Branch: refs/heads/3.0.x-fixes
Commit: 5b16890222c710fa65e7d3da8ff5d5d867c2a302
Parents: a511c50
Author: Ivo Studensky <istudens@redhat.com>
Authored: Tue Jul 25 16:04:34 2017 +0200
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Jul 28 12:20:33 2017 -0400

----------------------------------------------------------------------
 .../interceptors/WebFaultOutInterceptor.java    | 28 +++++++++++---------
 1 file changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5b168902/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 4d2a014..59afa33 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
@@ -35,6 +35,7 @@ import javax.xml.ws.soap.SOAPFaultException;
 
 import org.apache.cxf.annotations.SchemaValidation.SchemaValidationType;
 import org.apache.cxf.binding.soap.SoapFault;
+import org.apache.cxf.binding.soap.SoapVersion;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.logging.LogUtils;
@@ -100,20 +101,23 @@ public class WebFaultOutInterceptor extends FaultOutInterceptor {
                 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());    
+                SoapVersion soapVersion = (SoapVersion)message.get(SoapVersion.class.getName());
+                if (soapVersion != null && soapVersion.getVersion() != 1.1) {
+                    if (f instanceof SoapFault) {
+                        for (Iterator<QName> it = CastUtils.cast(sf.getFault().getFaultSubcodes());
it.hasNext();) {
+                            ((SoapFault) f).addSubCode(it.next());
+                        }
                     }
-                }
-                if (sf.getFault().getFaultReasonLocales().hasNext()) {
-                    Locale lang = (Locale) sf.getFault()
-                           .getFaultReasonLocales().next();
-                    String convertedLang = lang.getLanguage();
-                    String country = lang.getCountry();
-                    if (country.length() > 0) {
-                        convertedLang = convertedLang + '-' + country;
+                    if (sf.getFault().getFaultReasonLocales().hasNext()) {
+                        Locale lang = (Locale) sf.getFault()
+                                .getFaultReasonLocales().next();
+                        String convertedLang = lang.getLanguage();
+                        String country = lang.getCountry();
+                        if (country.length() > 0) {
+                            convertedLang = convertedLang + '-' + country;
+                        }
+                        f.setLang(convertedLang);
                     }
-                    f.setLang(convertedLang);
                 }
                 message.setContent(Exception.class, f);
             }


Mime
View raw message