Consuming Webservice with SSL certificate in NetBeans: How to configure Truststore and KeyStrore

StackOverflow https://stackoverflow.com/questions/13288427

  •  27-11-2021
  •  | 
  •  

문제

I have generated the client Binding using NetBeans

NetBeans -> New -> Java Project

Right Click -> Webservice Client Here I gave my wsdl url and generated the client bindings.

I want to configure KeyStore, TrustStore.

I have client.cer and server.cer files with me.

If through Code also cert can be signed please share the process.

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top