Skip to content

Commit 21b5004

Browse files
committed
NullPointerException for request with no SOAP body
SaajSoapEnvelope now throws an exception when the SOAP envelope contains no SOAP body. Issue: SWS-887
1 parent 7d64beb commit 21b5004

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-ws-core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapEnvelope.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public SoapBody getBody() {
5151
if (body == null) {
5252
try {
5353
SOAPBody saajBody = getSaajEnvelope().getBody();
54+
if (saajBody == null) {
55+
throw new SaajSoapBodyException("SAAJ SOAP message has no body");
56+
}
5457
if (saajBody.getElementQName().getNamespaceURI()
5558
.equals(SoapVersion.SOAP_11.getEnvelopeNamespaceUri())) {
5659
body = new SaajSoap11Body(saajBody, langAttributeOnSoap11FaultString);

0 commit comments

Comments
 (0)