troubleshooting Question

Calling HTTPS webservices using Axis and Soap

Avatar of prohacx
prohacx asked on
Java EE
9 Comments1 Solution10501 ViewsLast Modified:
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.trustStore", "CustomKeyStore");
        System.setProperty("javax.net.ssl.trustStorePassword", "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(url);
           
           
            // 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.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 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!
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros