Skip to content

Commit 2004935

Browse files
committed
SWS-486 - SaajSoap11Body.getFault() does not conforms to interface specification - if no fault is present IllegalArgumentException is thrown instead of returning null.
1 parent 6bafbd1 commit 2004935

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap11Body.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
*/
3737
class SaajSoap11Body extends SaajSoapBody implements Soap11Body {
3838

39-
public SaajSoap11Body(SOAPBody body) {
39+
SaajSoap11Body(SOAPBody body) {
4040
super(body);
4141
}
4242

4343
public SoapFault getFault() {
4444
SOAPFault fault = getImplementation().getFault(getSaajBody());
45-
return new SaajSoap11Fault(fault);
45+
return fault != null ? new SaajSoap11Fault(fault) : null;
4646
}
4747

4848
public Soap11Fault addFault(QName faultCode, String faultString, Locale faultStringLocale) {

core/src/main/java/org/springframework/ws/soap/saaj/SaajSoap12Body.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
*/
3737
class SaajSoap12Body extends SaajSoapBody implements Soap12Body {
3838

39-
public SaajSoap12Body(SOAPBody body) {
39+
SaajSoap12Body(SOAPBody body) {
4040
super(body);
4141
}
4242

4343
public SoapFault getFault() {
4444
SOAPFault fault = getImplementation().getFault(getSaajBody());
45-
return new SaajSoap12Fault(fault);
45+
return fault != null ? new SaajSoap12Fault(fault) : null;
4646
}
4747

4848
public SoapFault addClientOrSenderFault(String faultString, Locale locale) {

0 commit comments

Comments
 (0)