簡體   English   中英

cxf ws-security timestamp格式

[英]cxf ws-security timestamp format

我正在創建一個與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”);

科爾姆。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM