SOAPMessage soapMessage = newSOAPMessage(is, (SoapMessage)message);
//workaround bugs in SAAJ
//calling getSOAPBody does wacky things with the InputStream so
//attachements can be lost. Count them first to make sure they
//are properly sucked in.
soapMessage.countAttachments();
//This seems to be a problem in SAAJ. Envelope might not be initialized
//properly without calling getEnvelope()
soapMessage.getSOAPPart().getEnvelope();