cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CXF-3442) SAAJInInterceptor should not swallow the exception
Date Wed, 06 Apr 2011 08:56:05 GMT
SAAJInInterceptor should not swallow the exception
--------------------------------------------------

                 Key: CXF-3442
                 URL: https://issues.apache.org/jira/browse/CXF-3442
             Project: CXF
          Issue Type: Improvement
          Components: Soap Binding
            Reporter: Willem Jiang
            Assignee: Willem Jiang
            Priority: Minor
             Fix For: 2.4, 2.3.4


When sending an invalid SOAP message specifically with an incorrect end tag:
{code}
snip...
  <soapenv:Body>
      <cus:lookupCustomer>
         <customerId>1</customerId>
         <customerId2>1</customerId2>
      <cus:lookupCustomer>   <------- no slash.
   </soapenv:Body>
end snip..
{code}
The wrong SOAP fault is thrown when using the WSS4JInInterceptor:
{code}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Client</faultcode>
         <faultstring>Problems creating SAAJ object model</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>
{code}
When the WSS4JInInterceptor is removed the following exception is thrown:
{code}
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Client</faultcode>
         <faultstring>Unmarshalling Error: cvc-complex-type.2.4.d: Invalid content was
found starting with element 'cus:lookupCustomer'. No child element is expected at this point.</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>
{code}

If you enable the WSS4JInInterceptor, CXF will use SAAJInInterceptor to create a SOAP message
for using.
That could explain that you got the "Problems creating SAAJ object model" message.
I just checked the code of SAAJInInterceptor, it just wrap the real cause of exception message
like this
{code}
} catch (SOAPException soape) {
            throw new SoapFault(new org.apache.cxf.common.i18n.Message(
                    "SOAPHANDLERINTERCEPTOR_EXCEPTION", BUNDLE), soape,
                    message.getVersion().getSender());
        } catch (XMLStreamException e) {
            throw new SoapFault(new org.apache.cxf.common.i18n.Message(
                    "SOAPHANDLERINTERCEPTOR_EXCEPTION", BUNDLE), e, message
                    .getVersion().getSender());
        }
{code}
To make sure the CXF client can get the exception message rightly, I think we just let the
SAAJInInterceptor use the exception message directly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message