public static Element getSOAPHeader(Document doc) { String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); return XMLUtils.getDirectChildElement( doc.getDocumentElement(), WSConstants.ELEM_HEADER, soapNamespace ); }
/** * Get the default encryption part - the SOAP Body of type "Content". */ public static WSEncryptionPart getDefaultEncryptionPart(Document doc) { String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); return new WSEncryptionPart(WSConstants.ELEM_BODY, soapNamespace, "Content"); }
/** * Returns the first WS-Security header element for a given actor. Only one * WS-Security header is allowed for an actor. * * @param doc * @param actor * @return the <code>wsse:Security</code> element or <code>null</code> * if not such element found */ public static Element getSecurityHeader(Document doc, String actor) throws WSSecurityException { Element soapHeaderElement = getSOAPHeader(doc); if (soapHeaderElement == null) { // no SOAP header at all return null; } String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); return getSecurityHeader(soapHeaderElement, actor, WSConstants.URI_SOAP12_ENV.equals(soapNamespace)); }
); String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); String soapPrefix = XMLUtils.setNamespace(
try { if ("Header".equals(modifier)) { String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); if (elementToEncrypt.getParentNode().getNamespaceURI().equals(soapNamespace) && WSConstants.ELEM_HEADER.equals(elementToEncrypt.getParentNode().getLocalName())) {
boolean doCreate ) throws WSSecurityException { String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); Element header = XMLUtils.getDirectChildElement(
WSSecurityUtil.getSOAPNamespace(getDocument().getDocumentElement()); WSEncryptionPart encP = new WSEncryptionPart("STRTransform", soapNamespace, "Content");