No. I typed what I said. But I am quite sure, that that is wrong. I don't think I should type :
It really doesn't sound correct.
But why I can perform programmatic something like this :
[code]
import java.util.logging.Logger;
import javax.xml.ws.BindingProvider;
import java.util.*;
import securityC.*;
import javax.xml.ws.handler.MessageContext;
public class SecurityClient {
private static Logger logger =Logger.getLogger("SecurityClient");
private static final
String endpoint = "https://localhost:8443/slersec/sler";
public static void main(String[] args) {
try{
SlerSecurityService service = new SlerSecurityService();
SlerSecurity port = service.getSlerSecurityPort();
/*
Properties props = new Properties();
props.put("javax.net.ssl.trustStore", System.getProperty ("user.home"));
props.put("javax.net.ssl.trustStorePassword", "changeot");
props.put("javax.net.ssl.keyStore", System.getProperty ("user.home"));
props.put("javax.net.ssl.keyStorePassword", "changeit");
Map<String, Object> req_ctx = ((BindingProvider) port).getRequestContext();
req_ctx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
// Place the username/password in the HTTP request headers,
// which a non-Java client can do as well.
Map<String, List><String>> hdr = new HashMap<String, List><String>>();
hdr.put("username", Collections.singletonList("afrodom"));
hdr.put("password", Collections.singletonList("slobodan"));
req_ctx.put(MessageContext.HTTP_REQUEST_HEADERS, hdr);
logger.info("Invoking secret key . . . ");
logger.info("The answer is : \n "+ port.secretInfo("love"));
logger.info("check user validation . . . : ");
}catch (Exception e){
e.printStackTrace();
}
}
}
Should I also pay attention on self-created .keystore file in user home dir. on client side, or sler.keystore on server side? How would you solve this problem?