views:

628

answers:

4

Hi

I want to consume a web service over https from a java client. What steps will i need to take in order to do this?

+2  A: 

Really, there shouldn't much different from consuming a web service over HTTP. The big thing is that the process calling the web service will have to trust the server's SSL certificate. If the certificate was purchased from a well-known certificate-issuing authority, this usually isn't a problem. Otherwise, the client will want to either trust the root certificate, or the certificate associated with the server's fully qualified host name.

Blair Conrad
A: 

Blair says it right. all the same, try it out using SoapUI , which is a web service test client. This is an open source utility : so you get a chance to see how things work under the covers.

anjanb
A: 

Thanks guys

Are there any extra steps involving certs or anything like that that i need to look into?

Damo
+2  A: 

You may need to use the http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html">keytool command to trust the server's SSL certificate. I've generally found that it is necessary to run something like this:

keytool -importcert -v -trustcacerts -alias ServerName -file server_cert_file.crt -keystore client_keystore_file
Ian McLaird
Hi IanThansk for your answer. Do you find that your trsusstore password and server cert password must match up when you do this?
Damo
Strictly speaking, I don't think that they have to match. I've never done it any other way, though.
Ian McLaird