I am tring to add an outgoingWss item for authentication with certificate. The groovy code is listed below. The outgoingWss entry is created as expected except parts missed. 'Timestamp' and 'Body' are expected in Parts. Any idea or suggestion?
if (!WssC.getOutgoingWssByName("mycert")) {
def owss_cert = WssC.addOutgoingWss("mycert");
TimestampEntry timeEntry=(TimestampEntry) owss_cert.addEntry("Timestamp");
timeEntry.setTimeToLive("500");
timeEntry.setStrictTimestamp(true);
SignatureEntry signature = (SignatureEntry) owss_cert.addEntry("Signature")
signature.setCrypto("myKeystore.jks");
signature.setUsername("mycert");
signature.setPassword("passwords");
signature.setKeyIdentifierType(1);
signature.setUseSingleCert(true);
List<StringToStringMap> parts = new ArrayList<StringToStringMap>();
StringToStringMap ts = new StringToStringMap();
ts.put("ID", "");
ts.put("Name", "Timestamp");
ts.put("Namespace", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
ts.put("Encode", "Content");
parts.add(ts);
StringToStringMap body = new StringToStringMap();
body.put("ID", "");
body.put("Name", "Body");
body.put("Namespace", "http://schemas.xmlsoap.org/soap/envelope");
body.put("Encode", "Content");
parts.add(body);
signature.setParts(parts);
signature.saveConfig();
}
Hi @guoff,
Was the answer to your question found? Please share your solution with us.
User | Count |
---|---|
4 | |
3 | |
2 | |
1 | |
1 |
Subject | Author | Latest Post |
---|---|---|