[SWS-486] SaajSoap11Body.getFault() does not conforms to interface specification - if no fault is present IllegalArgumentException is thrown instead of returning null. Created: 17/Feb/09  Updated: 04/May/12  Resolved: 12/May/09

Status: Closed
Project: Spring Web Services
Component/s: None
Affects Version/s: 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6
Fix Version/s: 1.5.7

Type: Bug Priority: Major
Reporter: Oleksandr Alesinskyy Assignee: Arjen Poutsma
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified



the call

SoapFault bodyFault = body == null ? null : body.getFault();

returns following exception (line numbers are from Spring-WS 1.5.1, but relevant code is the same in 1.5.6 as well).

java.lang.IllegalArgumentException: element must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.ws.soap.saaj.SaajSoapElement.<init>(SaajSoapElement.java:40)
at org.springframework.ws.soap.saaj.SaajSoapFault.<init>(SaajSoapFault.java:36)
at org.springframework.ws.soap.saaj.SaajSoap11Fault.<init>(SaajSoap11Fault.java:34)
at org.springframework.ws.soap.saaj.SaajSoap11Body.getFault(SaajSoap11Body.java:45)
at com.navteq.ncs.common.core.utils.aop.EndpointInvokeInterceptor.checkResult(EndpointInvokeInterceptor.java:46)

while SoapBody interface Javadoc states for this method:
the SoapFault, or null if none is present

The getFault() method in the class SaajSoap11Body may be modified as follows

public SoapFault getFault()

{ SOAPFault fault = getImplementation().getFault(getSaajBody()); return fault==null ? null : new SaajSoap11Fault(fault); }

Comment by Oleksandr Alesinskyy [ 17/Feb/09 ]


SaajSoap12Body is affected as well, while AxiomSoapBody is Ok.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Thu Nov 15 17:07:15 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.