check subCodes only in case of SOAP 1.2
This closes
@@ -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;
@@ -99,6 +100,8 @@ public class WebFaultOutInterceptor extends FaultOutInterceptor {
sf = (SOAPFaultException)thr.getCause();
}
if (sf != null) {
+ 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());
@@ -114,6 +117,7 @@ public class WebFaultOutInterceptor extends FaultOutInterceptor {
}
f.setLang(convertedLang);
}
+ }
message.setContent(Exception.class, f);
}
} catch (Exception e) {
