我正在创建与WSDL交互的SOAP客户端,网址为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(“ precisionInMilliseconds”,“ false”);
科尔姆
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句