I need to implement some JAX-WS client (for Websphere Application Server 7), that will request server using SSL. The question is, how to set SSL certificate into WS request dynamically? I want to use the way, which is presented here http://www-01.ibm.com/support/knowledgecenter/SSAW57_7.0.0/com.ibm.websphere.nd.doc/info/ae/ae/tjw_security_https.html That means to use the setting SSL configuration alias for referencing to configuration. This looks easily, but this example is for JAX-RPC and I would like to know, if is possible this kind of configuration if I use JAX-WS. Is something like this possible with JAX-WS? Thanks
BindingProvider bindingProvider = (BindingProvider) importIsdn;
bindingProvider.getBinding().getHandlerChain().add(new Handler() {
public boolean handleMessage(MessageContext context) {
context.put("ssl.configName", wsClient.getSslConfigName());
return true;
}
public boolean handleFault(MessageContext context) {
return false;
}
public void close(MessageContext context) {
}
});
If you are using JAX-WS, check if you can use policy sets instead of doing it in the code.
Create policy based on
WSHTTPS default
, then in create binding and specify SSL configs to be used (you can select SSL configuration alias there). Attach policy to the JAX-WS client via admin console.