You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ivo Studensky (JIRA)" <ji...@apache.org> on 2017/07/25 14:04:01 UTC
[jira] [Updated] (CXF-7453) WebFaultOutInterceptor calls
getFaultSubcodes() even in case of SOAP1.1 faults
[ https://issues.apache.org/jira/browse/CXF-7453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ivo Studensky updated CXF-7453:
-------------------------------
Affects Version/s: 3.1.12
> WebFaultOutInterceptor calls getFaultSubcodes() even in case of SOAP1.1 faults
> ------------------------------------------------------------------------------
>
> Key: CXF-7453
> URL: https://issues.apache.org/jira/browse/CXF-7453
> Project: CXF
> Issue Type: Bug
> Components: JAX-WS Runtime
> Affects Versions: 3.1.12
> Reporter: Ivo Studensky
>
> When {{SOAPFaultException}} is thrown in an application with SOAP 1.1, the {{WebFaultOutInterceptor}} calls {{getFaultSubcodes}} method relevant for SOAP 1.2 only and that leads to an error message logged in a server log in case of SOAP 1.1.
> Code snippet:
> {code:java|title=cxf-3.1.10/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WebFaultOutInterceptor.java}
> 88 public void handleMessage(Message message) throws Fault {
> 89 Fault f = (Fault)message.getContent(Exception.class);
> 90 if (f == null) {
> 91 return;
> 92 }
> 93 try {
> 94 Throwable thr = f.getCause();
> 95 SOAPFaultException sf = null;
> 96 if (thr instanceof SOAPFaultException) {
> 97 sf = (SOAPFaultException)thr;
> 98 } else if (thr.getCause() instanceof SOAPFaultException) {
> 99 sf = (SOAPFaultException)thr.getCause();
> 100 }
> 101 if (sf != null) {
> 102 if (f instanceof SoapFault) {
> 103 for (Iterator<QName> it = CastUtils.cast(sf.getFault().getFaultSubcodes()); it.hasNext();) { // <-- here
> 104 ((SoapFault) f).addSubCode(it.next());
> 105 }
> 106 }
> 107 if (sf.getFault().getFaultReasonLocales().hasNext()) {
> 108 Locale lang = (Locale) sf.getFault()
> 109 .getFaultReasonLocales().next();
> 110 String convertedLang = lang.getLanguage();
> 111 String country = lang.getCountry();
> 112 if (country.length() > 0) {
> 113 convertedLang = convertedLang + '-' + country;
> 114 }
> 115 f.setLang(convertedLang);
> 116 }
> 117 message.setContent(Exception.class, f);
> 118 }
> 119 } catch (Exception e) {
> 120 // do nothing; // <- UnsupportedOperationException is swallowed here.
> 121 }
> 122 Throwable cause = f.getCause();
> 123 WebFault fault = null;
> 124 if (cause != null) {
> 125 fault = getWebFaultAnnotation(cause.getClass());
> 126 }
> :
> {code}
> Both SOAP1.1 and 1.2 the "getFaultSubcodes()" is called, but SOAP 1.1 does not have an attribute "faultsubcoded" which leads to the message logged in the log.
> The "getFaultSubcodes()" should be called only in case of SOAP1.2 usage.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)