[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


 Description   

Hi,

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:
Returns:
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); }

 Comments   
Comment by Oleksandr Alesinskyy [ 17/Feb/09 ]

Hi,

SaajSoap12Body is affected as well, while AxiomSoapBody is Ok.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Mon Dec 11 04:09:54 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.