* if true create a new WSS header block if none exists
* @return the WSS header or null if none found and doCreate is false
*/
public static Element findWsseSecurityHeaderBlock(Document doc,
Element envelope, String actor, boolean doCreate) {
SOAPConstants sc = getSOAPConstants(envelope);
Element wsseSecurity = getSecurityHeader(doc, actor, sc);
if (wsseSecurity != null) {
return wsseSecurity;
}
Element header = findChildElement(envelope, sc.getEnvelopeURI(), sc
.getHeaderQName().getLocalPart());
if (header == null) {
if (doCreate) {
header = createElementInSameNamespace(envelope, sc
.getHeaderQName().getLocalPart());
header = prependChildElement(doc, envelope, header, true);
}
}
if (doCreate) {