SOAPEnvelope unsignedEnvelope = message.getSOAPEnvelope();
SAMLIssuer saml = SAMLIssuerFactory.getInstance("saml.properties");
SAMLAssertion assertion = saml.newAssertion();
WSSecSAMLToken wsSign = new WSSecSAMLToken();
Document doc = unsignedEnvelope.getAsDocument();
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
LOG.info("Before SAMLUnsignedSenderVouches....");
Document signedDoc = wsSign.build(doc, assertion, secHeader);
LOG.info("After SAMLUnsignedSenderVouches....");
if (LOG.isDebugEnabled()) {
LOG.debug("Unsigned SAML message (sender vouches):");
String outputString =