LazyStreamBasedMessage lazyStreamMessage = (LazyStreamBasedMessage)message;
AttachmentSet attachSet = null;
if (!lazyStreamMessage.mtomLargeData()) {
attachSet = lazyStreamMessage.getAttachments();
}
SecurityRecipient recipient = null;
if(attachSet == null || attachSet.isEmpty()){
recipient = new SecurityRecipient(lazyStreamMessage.readMessage(),soapVersion);
} else{
recipient = new SecurityRecipient(lazyStreamMessage.readMessage(),soapVersion, attachSet);
}
recipient.setBodyPrologue(lazyStreamMessage.getBodyPrologue());
recipient.setBodyEpilogue(lazyStreamMessage.getBodyEpilogue());
return recipient.validateMessage(context);
}