我正在编写一个带有一点 WS-Security(XML 签名)的简单 CXF 客户端和服务器。到目前为止,一切都很好。
...
outProps.put("signatureParts",
"{Element}{" + WSU_NS + "}Timestamp;"
+ "{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body;"
+ "{}{http://www.w3.org/2005/08/addressing}ReplyTo;");
outProps.put("signatureAlgorithm", "http://www.w3.org/2000/09/xmldsig#rsa-sha1");
...
client.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));
我想更改的是规范化算法EXCLUSIVE
(C14N_EXCL_OMIT_COMMENTS aka “ http://www.w3.org/2001/10/xml-exc-c14n# ”)。