List scList = null;
if(temp != null && temp instanceof ArrayList)
scList = (ArrayList)temp;
if(scList != null){
SignatureConfirmationHeaderBlock signConfirm = null;
SOAPElement sc = null;
try{
SOAPFactory factory = SOAPFactory.newInstance();
Name name = factory.createName(
MessageConstants.SIGNATURE_CONFIRMATION_LNAME,
MessageConstants.WSSE11_PREFIX,
MessageConstants.WSSE11_NS);
Iterator i = secHeader.getChildElements(name);
if(!i.hasNext()){
log.log(Level.SEVERE, LogStringsMessages.WSS_1428_SIGNATURE_CONFIRMATION_ERROR());
throw new XWSSecurityException("Message does not confirm to Security Policy:" +
"wss11:SignatureConfirmation Element not found");
}
while(i.hasNext()){
sc = (SOAPElement)i.next();
try{
signConfirm = new SignatureConfirmationHeaderBlock(sc);
} catch( XWSSecurityException xwsse){
log.log(Level.SEVERE, LogStringsMessages.WSS_1435_SIGNATURE_CONFIRMATION_VALIDATION_FAILURE(), xwsse);
throw SecurableSoapMessage.newSOAPFaultException(
MessageConstants.WSSE_INVALID_SECURITY,
"Failure in SignatureConfirmation validation\n" +
"Message is: " + xwsse.getMessage(),
xwsse );
}
String signValue = signConfirm.getSignatureValue();
//Case when there was no Signature in sent message, the received message should have one
//SignatureConfirmation with no Value attribute
if(signValue == null){
if(i.hasNext() || !scList.isEmpty()){