Question

I need to create web service client, the company which made service send us the wsdl files. I have wsdl files, username and password, service url's and txt file with some key like '20 a9 38 4e 82 3a 94 d1 ...'. The server has self signed certificate and i tried to get certificate through InstallCert.java , generating keystore with keytool etc. When i generate client from wsdl with axis2 wsdl2java it generates client but gives port 443 error at the end of generate process. when i test the service via web service explorer in eclipse i am getting 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 error. I also checked this error but i can't find solution.

Can anyone tell me please how should i generate client in eclipse apache tomcat with jdk 1.6, what is the difference between normal client.

Was it helpful?

Solution

First of all, the URL endpoint should be httpS not http and make your truststore/keystore available to JVM.

see: http://blog.technogemsinc.com/2008/02/https-connection-in-java.html

I used also https://code.google.com/p/misc-utils/wiki/JavaHttpsUrl about an year ago..

Use what is more convenient to you from the below two options

  1. Make truststore available to jvm

    -Djavax.net.ssl.trustStore="<%PATH_TO_TRUST_STORE%>\testkeys"

  2. Tell your Java/socket factory to use this "trust store":

    System.setProperty( "javax.net.ssl.trustStore", "keystore_file" );

    System.setProperty( "javax.net.ssl.trustStorePassword", "somepass" );

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