1

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?

3 Answers 3

3

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.

2

You may need to use the 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
2
  • Hi Ian Thansk for your answer. Do you find that your trsusstore password and server cert password must match up when you do this?
    – Damien
    Oct 2, 2008 at 19:32
  • Strictly speaking, I don't think that they have to match. I've never done it any other way, though. Oct 8, 2008 at 3:08
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.