Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top