Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error trying to access and external secure webservice

Elkgrove65May 2 2016 — edited May 3 2016

This question is Not Answered.

Elkgrove65   Newbie

Hi all,

I need help to figure out my current problem.  I'm using JDeveloper 11g Release 1(11.1.1.9.0) trying to call a external webservice.  Steps that I've taken:

1. Download certificate using same wsdl url using internet explorer (or any other browser)

2. Add certificate in a keystore

    I used the command below to import the cert into CHP.jks

       C:\oracle\Middleware\Oracle_FRHome1\jdk\bin\keytool -importcert -alias testkey -file CHP_Cert.cer -keystore  .\CHP.jks -storepass password1

3. In JDeveloper Tools->Preferences->Credentials, I set the Clients Trusted Certificate Keystore to point to the CHP.jks that was created in step #2 above.

HTTP Analyzer has no problem getting the information back from the webservice but when I try to run the code below


    public static void main(String[] args) {
        try {
            dataService = new DataService();
            DataServiceClient dataServiceClient = dataService.getWSHttpBinding_DataServiceClient();

            Map<String, Object> requestContext = ((BindingProvider) dataServiceClient).getRequestContext();
            setPortCredentialProviderList(requestContext);

            // Add your code to call the desired methods.
            System.out.format("\nTesting----");
           
        } catch (Exception ex) {
            ex.printStackTrace();
        }


I got this error.


C:\Oracle\Middleware\jdk160_29\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\CHPWebService\.adf;C:\JDeveloper\mywork\CHPWebService\CHPWebServiceProxy\classes;C:\oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar;C:\oracle\Middleware\oracle_common\modules\oracle.jrf_11.1.1\jrf.jar;C:\oracle\Middleware\modules\com.oracle.toplink_1.1.0.0_11-1-1-6-0.jar;C:\oracle\Middleware\modules\org.eclipse.persistence_1.2.0.0_2-3.jar;C:\oracle\Middleware\modules\com.bea.core.antlr.runtime_2.7.7.jar;C:\oracle\Middleware\modules\javax.persistence_1.1.0.0_2-0.jar -Djavax.net.ssl.trustStore=C:\oracle\Middleware\wlserver_10.3\server\lib\CHP.jks -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8099 -Dhttp.nonProxyHosts=~localhost -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8099 -Dhttps.nonProxyHosts=~localhost -Djavax.net.ssl.trustStore=C:\oracle\Middleware\wlserver_10.3\server\lib\CHP.jks org.tempuri.WSHttpBinding_DataServiceClientClient
Apr 27, 2016 6:41:06 AM weblogic.wsee.jaxws.spi.WLSProvider createServiceDelegate
WARNING: Could not read WSDL Definition from URL wsdlDocumentLocation: 2 counts of InaccessibleWSDLException.

javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://ciresexchangetest.chp.ca.gov/CIRESExchangeService/DataService.svc?wsdl. It failed with:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 31 2016
Added on May 2 2016
17 comments
878 views