Occasionally we'll get a null pointer in the JAXWS code.
Caused by: java.lang.NullPointerException
When we receive a SOAP message with an empty body (example below) the (T)callback.get() line in JaxwsResponseCallback throws a null pointer exception. We're still unsure why we're getting a message with an empty body in the first place, and if that's AIX related or we're just lucky in other operating systems.
<!-- Stuff in here that I've removed. -->
We did some debugging and checked where our code diverged between the two types of messages. The below chunk of code is where it starts to unravel.
When we do a StaxUtils.toNextElement that returns false, as it hits the end of the body immediately. This causes it to return without setting the MessageContentsList as a list on the message. Later, when the code tries to do a .getContent(List) it doesn't find anything, and this leads to it setting null as the first element returned on callback.get().