envelope = sm.getSOAPPart().getEnvelope();
SOAPHeader header = (SOAPHeader) Util.findElement(envelope, new QName(envelope.getNamespaceURI(), "Header"));
if (header == null) {
header = (SOAPHeader) envelope.getOwnerDocument().createElementNS(envelope.getNamespaceURI(),
envelope.getPrefix() + ":Header");
envelope.insertBefore(header, envelope.getFirstChild());
}
header.addChildElement(security);
} catch (SOAPException e) {
logger.jbossWSUnableToCreateBinaryToken(e);
}