2

我已经使用 NetBeans 生成了客户端绑定

NetBeans -> 新建 -> Java 项目

右键单击-> Webservice Client 在这里我给出了我的 wsdl url 并生成了客户端绑定。

我想配置 KeyStore、TrustStore。

我有client.cer 和server.cer 文件。

如果通过代码也可以签署证书,请分享过程。

4

1 回答 1

0

In your NetBeans Project

  1. Right Click on

    Project Root --> Web Service References --> service and Click on "Edit Webservice Attributes"

  2. A popup window will appear with service tag Please configure Keystore and Trustsotre in this window by clicking on respective buttons.

Once the configuration is done *\build\classes\META-INF\service.svc.wsdl_wsdl0.xml* file will be updated with keystore and trustore entry.

<wsp1:Policy wsu:Id="WS2007HttpBinding_IWebServicePolicy">
    <wsp1:ExactlyOne>
        <wsp1:All>
            <wsam:Addressing wsp1:Optional="false"/>
            <sc:KeyStore wspp:visibility="private" type="JKS" storepass="changeit" alias="client2" keypass="changeit" location="client.jks"/>
            <sc:TrustStore wspp:visibility="private" type="JKS" storepass="changeit" peeralias="chageit" location="server.jks"/>
        </wsp1:All>
    </wsp1:ExactlyOne>
</wsp1:Policy>
于 2012-11-22T08:08:48.363 回答