Friday, September 30, 2016

A weird java web service client error

When I developed web service client in Rational Application Developer, I got the below error:
Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: WSWS7130E: No Secure Sockets Layer (SSL) configuration is available for the https://... endpoint.

After searching the google, got a useful article "Using Secure Web Services HTTPs (SSL)":
http://btarlton.blogspot.ca/2013/03/ever-have-trouble-using-ssl-to-call-web.html
So I exported the certificate and add the below to VM arguments:
-Djavax.net.ssl.trustStore=C:\temp\myTrustStore -Djavax.net.ssl.trustStorePassword=changeit
Then the error "No Secure Sockets Layer ... " is gone.
However, another error is raised: "java.io.IOException: Connection close: Read failed.  Possible end of stream encountered. "

I searched a lot and tried some ways like setting com.ibm.websphere.webservices.http.requestResendEnabled but still got the error.

Finally I decided to regenerate the client from scratch using wsimport -keep, and copy them into RAD7.5, Phew, everything works perfect.

So what's the problem? I compared the two projects source code until they are all identical through WinMerge. But their behavior are still different.
Then I checked the projects setting in RAD and removed the auto introduced WAS_V7JAXWS_WEBSERVICES_THINCLIENT, now both of them works like a charm.

It's so misleading and confusing for the IDE especially if it involves IBM product. Under such case, should remove the dependency on IDE as much as possible
so that we can isolate the issue.

No comments:

Post a Comment