Do 17 Apr 2008
WebService Call fails: Invalid trust file name of null
Geschrieben von Jürgen Mayer unter Software, Erfahrungen
Tags: development, experience, Java, WebService
Keine Kommentare
A WebService Client Call (IBM Implementation) fails with the following error: Invalid trust file name of null
Cause: The SSL context can’t be created because no java keystore is set. There is one possible solution: Place the following code into your client, before the client code ist called. This approach is independend from the IBM webservice client implementation of cause, any time you want to set the keystore programmatically use this code. Maybe if you have a WebService client created by the AXIS framework.
System.setProperty(”javax.net.ssl.trustStore”, “%JAVA_HOME%/jre/lib/security/cacerts”);
System.setProperty(”javax.net.ssl.trustStorePassword”, “changeit”);
System.setProperty(”javax.net.ssl.keyStore”, “%JAVA_HOME%/jre/lib/security/cacerts”);
System.setProperty(”javax.net.ssl.keyStorePassword”, “changeit”);
Be aware of the Java Runtime Environment you use, in a IBM Websphere environment standard keystore password is “WebAS” I think. “changeit” is the standard password for Java Runtime Environment.
If your WebService endpoint starts with https, you may need to import a certificate into your keystore. This is the case for test environments where self signed certificates are used quite often. To do this use java keytool or ikeyman (WebSphere Application Server based products) .