我正在创建一个soap客户机,它与wsdl在https://ws.conf.ebs.health.gov.on.ca:1440/HCVService/HCValidationService?wsdl
这是我第一次实现soap客户端,我使用CXF
请求的时间戳格式有问题。
预计格式:2014-08-05T17:46:51Z
我的格式:2014-08-05T17:42:09.954Z
所以问题是,如何配置时间戳以便删除后面的子秒?
提前非常感谢。
相关代码:

    Map<String,Object> inProps= new HashMap<String,Object>();

    WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps);
    cxfEndpoint.getInInterceptors().add(wssIn);

    Map<String,Object> outProps = new HashMap<String,Object>();

    WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
    cxfEndpoint.getOutInterceptors().add(wssOut);

    outProps.put("action", "UsernameToken Timestamp Signature");

    outProps.put("passwordType", WSConstants.PW_TEXT);

最佳答案

添加以下代码行+它应该可以工作:
outprops.put(“精度以毫秒为单位”,“false”);
科尔姆。

09-11 19:16