a setup for dynamically choosing the client certificate used for SSL Authenticat

// create config
boolean logging = false; // no logging
SSLClientAxisEngineConfig axisConfig = new SSLClientAxisEngineConfig();
axisConfig.setKeystore("/path/to/clientkey.p12");
axisConfig.setKeystoreType("PKCS12");
axisConfig.setKeystorePassword("changeit");
axisConfig.setTruststore("/path/to/truststore.jks");
axisConfig.setTruststoreType("JKS");
axisConfig.setTruststorePassword("changeit");
if (logging)
    axisConfig.setDebugBaseDir("/path/to/logs");
axisConfig.initialize(logging);
// initialize service
URL soapURL = new URL("https://myserver.com/myapp/services/mywebserviceport");
MyWebServiceServiceLocator locator = new MyServiceLocator(axisConfig);
MyWebServicePort port = locator.getMyWebServicePort(soapURL);
MyWebServiceBindingStub stub = (MyWebServiceBindingStub) port;
// make a call to the webservice (assume no params for this operation)
MyResultType result = stub.myoperation1();

 

 

http://wiki.apache.org/ws/FrontPage/Axis/DynamicSSLConfig

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章