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!
ASKER CERTIFIED SOLUTION
Mayank S
Principal Technologist

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 9 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 9 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004