具有密码摘要的JAX-WS SOAP客户端

时间:2018-08-25 05:24:55

标签: java web-services soap jax-ws soap-client

我正在尝试创建一个ws的客户端(使用wsimport),该客户端需要带有摘要的UsernameToken标头。

标题必须是这样的:

<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsu:Timestamp wsu:Id="TS-32E6B34377D7E4A58614607283662392">
        <wsu:Created>xxxx</wsu:Created>
        <wsu:Expires>xxxxx</wsu:Expires>
    </wsu:Timestamp>
    <wsse:UsernameToken wsu:Id="UsernameToken-32E6B34377D7E4A58614607283662221">
        <wsse:Username>xxxx</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">xxxxx</wsse:Password>
        <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xxxxxxx</wsse:Nonce>
        <wsu:Created>xxxxxx</wsu:Created>
    </wsse:UsernameToken>
</wsse:Security>

这似乎是默认的soap标头,但我找不到生成它的简单方法。

如何在请求中添加此标头?

谢谢。

0 个答案:

没有答案