I am getting Soap Response from this code
SOAPConnectionFactory sfc = SOAPConnectionFactory.newInstance();
SOAPConnection connection = sfc.createConnection();
SOAPMessage soapMessageResponse = connection.call(soapRequest, new URL(serviceLocation));
How can I make it SSL based?
I know how to create SSLSocketFactory
from SSLContext
giving my specified keystore.
How can I tell SOAPConnection
class about SSLSocketFactory
or SSLContext
? So that my communication can be secured.
I do not want to set keystore in system property or xml file. I am using Websphere 7.
EDIT:
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at com.ibm.ws.webservices.engine.soap.SOAPConnectionImpl.callJAXWSDispatch(SOAPConnectionImpl.java:416)
... 49 more
Caused by: javax.xml.soap.SOAPException: javax.xml.ws.WebServiceException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at com.ibm.ws.webservices.engine.xmlsoap.saaj13only.SOAPConnectionJAXWS.call(SOAPConnectionJAXWS.java:72)
... 54 more
Caused by: javax.xml.ws.WebServiceException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem