NullPointerException for request with no SOAP body

SaajSoapEnvelope now throws an exception when the SOAP envelope contains
no SOAP body.

Issue: SWS-887
This commit is contained in:
Arjen Poutsma
2015-03-18 10:10:56 +01:00
parent 7d64bebd19
commit 21b5004162

View File

@@ -51,6 +51,9 @@ class SaajSoapEnvelope extends SaajSoapElement<SOAPEnvelope> implements SoapEnve
if (body == null) {
try {
SOAPBody saajBody = getSaajEnvelope().getBody();
if (saajBody == null) {
throw new SaajSoapBodyException("SAAJ SOAP message has no body");
}
if (saajBody.getElementQName().getNamespaceURI()
.equals(SoapVersion.SOAP_11.getEnvelopeNamespaceUri())) {
body = new SaajSoap11Body(saajBody, langAttributeOnSoap11FaultString);