Axis 2 Web服务SSL通信 [英] Axis 2 webservice SSL communication
本文介绍了Axis 2 Web服务SSL通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从此代码获得肥皂响应
SOAPConnectionFactory sfc = SOAPConnectionFactory.newInstance();
SOAPConnection connection = sfc.createConnection();
SOAPMessage soapMessageResponse = connection.call(soapRequest, new URL(serviceLocation));
如何使其基于SSL?
我知道如何从SSLContext
创建给我指定的 keystore 的SSLSocketFactory
.
I know how to create SSLSocketFactory
from SSLContext
giving my specified keystore.
如何告诉SOAPConnection
类有关SSLSocketFactory
或SSLContext
的信息?这样可以确保我的通讯安全.
How can I tell SOAPConnection
class about SSLSocketFactory
or SSLContext
? So that my communication can be secured.
我不想在系统属性或xml文件中设置密钥库.我正在使用Websphere 7.
I do not want to set keystore in system property or xml file. I am using Websphere 7.
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
推荐答案
在使用SSL的情况下,此行代码无效.
This line of code will not work in case of SSL.
SOAPMessage soapMessageResponse = connection.call(soapRequest, new URL(serviceLocation));
为了通过SSL从Axis2 Web服务获得响应,您需要打开如给定的[here][1]
之类的流.
In order to get response through SSL from axis2 webservice you need to open streams like given [here][1]
.
这篇关于Axis 2 Web服务SSL通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文