| Author |
How do you create a webservice client using WSDL2Java which uses SSL?
|
prem saggar
Ranch Hand
Joined: Aug 24, 2000
Posts: 66
|
|
Hi everyone. I'm trying to create a webservice client using wsdl2java and it must comunicate with the webservice via SSL. I have the keystores set up for this. How do I get WSDL2Java to generate https ready code using my keystores? Thanks, guys. Prem
|
 |
Rr Kumaran
Ranch Hand
Joined: Sep 17, 2001
Posts: 548
|
|
there is nothing like ready code. 1. Import the server certificats in ur client truststore, 2. run wsdl2java on https endpoint and generate the stubs 3. set below properties in ur client program System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); Security.addProvider (new com.sun.net.ssl.internal.ssl.Provider()); System.setProperty("javax.net.ssl.trustStore", "<trust store location>"); System.setProperty("javax.net.ssl.trustStoreType", "jks | JCEKS"); System.setProperty("javax.net.ssl.trustStorePassword", "??"); System.setProperty("javax.net.ssl.keyStoreType", "jks"); System.setProperty("javax.net.ssl.keyStore", "<trust store location>"); System.setProperty("javax.net.ssl.keyStorePassword", "??");
|
RR Kumaran
SCJP 1.4
|
 |
Peter Hu
Ranch Hand
Joined: Apr 15, 2005
Posts: 33
|
|
|
If the keystore has more than one key, which one will be used for the communication with the server?
|
 |
prem saggar
Ranch Hand
Joined: Aug 24, 2000
Posts: 66
|
|
I agree with the question above. Which key is used in the keystore if there are multiple keys? Thanks for all the help. Prem
|
 |
William Barnes
Ranch Hand
Joined: Mar 16, 2001
Posts: 965
|
|
|
You only want one key per keystore/truststore.
|
Please ignore post, I have no idea what I am talking about.
|
 |
Peter Hu
Ranch Hand
Joined: Apr 15, 2005
Posts: 33
|
|
|
My application needs to connect with a couple of different web services servers at the same time. I have to use multiple certificates. How do my web services client knows which one to pick?
|
 |
philber fang
Greenhorn
Joined: Dec 30, 2004
Posts: 12
|
|
Hi RR Kumaran and others, If the client is not a standalone java client, but a servlet running on Websphere 5, is it still the same that I just set the properties you mentioned below in my servlet calling the web services? All any one knows the steps to set this(client only) up in websphere? Since the JVM is in the container though. Thanks in advance!!!
Originally posted by RR Kumaran: there is nothing like ready code. 1. Import the server certificats in ur client truststore, 2. run wsdl2java on https endpoint and generate the stubs 3. set below properties in ur client program System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol"); Security.addProvider (new com.sun.net.ssl.internal.ssl.Provider()); System.setProperty("javax.net.ssl.trustStore", "<trust store location>"); System.setProperty("javax.net.ssl.trustStoreType", "jks | JCEKS"); System.setProperty("javax.net.ssl.trustStorePassword", "??"); System.setProperty("javax.net.ssl.keyStoreType", "jks"); System.setProperty("javax.net.ssl.keyStore", "<trust store location>"); System.setProperty("javax.net.ssl.keyStorePassword", "??");
|
 |
 |
|
|
subject: How do you create a webservice client using WSDL2Java which uses SSL?
|
|
|