WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
List<WSEncryptionPart> encParts = new ArrayList<WSEncryptionPart>();
encParts.add(
new WSEncryptionPart(
"add",
"http://ws.apache.org/counter/counter_port_type",
"Element"));
encrypt.setParts(encParts);
Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
if (LOG.isDebugEnabled()) {
LOG.debug("After Encryption....");
String outputString =
XMLUtils.PrettyDocumentToString(encryptedDoc);
LOG.debug(outputString);
}
List<WSEncryptionPart> sigParts = new ArrayList<WSEncryptionPart>();
sigParts.add(
new WSEncryptionPart(
WSConstants.ENC_DATA_LN,
WSConstants.ENC_NS,
"Element"));
sign.setParts(sigParts);