/** * Prepends the SAML Assertion to the elements already in the * Security header. * * The method can be called any time after <code>prepare()</code>. * This allows to insert the SAML assertion at any position in the * Security header. * */ public void prependToHeader() { try { Element element = getElement(); if (element != null) { Element securityHeaderElement = getSecurityHeader().getSecurityHeaderElement(); WSSecurityUtil.prependChildElement(securityHeaderElement, element); } } catch (WSSecurityException ex) { throw new RuntimeException(ex.toString(), ex); } }