Hi,
I'm pretty new in this webservice thing and I want to call a webservice deployed over HTTPS.
My current code is like so:
System.setProperty("javax.
net.ssl.tr
ustStore",
"CustomKeyStore");
System.setProperty("javax.
net.ssl.tr
ustStorePa
ssword", "littlesecret");
String endpoint = "
https://brsla-cadev-vm3/axis/services/USD_R11_WebService?wsdl";
String user = "someuser";
String pwd = "somepassword";
try
{
// create a new web service stub instance
USD_WebServiceLocator ws = new USD_WebServiceLocator();
java.net.URL url = new java.net.URL(endpoint);
USD_WebServiceSoap usd = ws.getUSD_WebServiceSoap(u
rl);
// login to server
int sid = usd.login(user, pwd);
When deploying the service over HTTP I don't have any problems and can access all methods of the web service. However, over HTTPS, I keep on getting Java errors.
I already created a keystore and it looks like the code has no problems accessing that. However, now I run in errors like this:
javax.net.ssl.SSLHandshake
Exception:
sun.security.validator.Val
idatorExce
ption: PKIX path building failed: sun.security.provider.cert
path.SunCe
rtPathBuil
derExcepti
on: unable to find valid certification path to requested target
All I'm looking for is a simple example of calling a method over HTTPS, but I seem to be unable to find that anywhere. Kind of stuck here....
Can anyone help me please?
Thanks in advance!
Where is CustomKeyStore located? Is it in the same directory as the main class running your application?