CXF客户端加密,解密和签名

时间:2014-08-27 14:37:11

标签: security cxf

我使用CXF 3.0.0开发了Web服务客户端。

当我向服务器发送WS请求时,我必须加密标题和正文。以下是我的cxf-client.xml配置

 <jaxws:client name="{http://batchtransfer.em.emm.ericsson.com}PushFromBankBindingPort" createdFromAPI="true">
        <jaxws:properties>
            <entry key="ws-security.callback-handler" value="com.ClientKeystorePasswordCallback"/>        
            <entry key="ws-security.encryption.properties" value="clientKeystore.properties"/>
            <entry key="ws-security.signature.properties" value="clientKeystore.properties"/>
            <entry key="ws-security.encryption.username" value="myservicekey"/>
        </jaxws:properties>
</jaxws:client>

当我试图运行客户端时,我得到一个例外说

  

引起:org.apache.cxf.ws.policy.PolicyException:安全性   无法检测到配置。可能的原因:确保   jaxws:name属性值与端点端口匹配的客户端元素   定义以及ws-security.signature.properties元素   在其中

以下是我的wsdl端口定义。

<service name="PushFromBankBindingService">
    <port binding="iso:PushFromBankBinding" name="PushFromBankBindingPort">
    <soap:address location="http://127.0.0.1:9001/PushFromBankBindingPortImpl"/>
    </port>
</service>

我将clientKeystore.properties放在正确的位置,密钥库密码也正确。

但我不知道问题是什么。请帮忙

0 个答案:

没有答案
相关问题