在WAS 9中调用Webservice时面临java.lang.reflect.InvocationTargetException

时间:2018-06-28 16:45:41

标签: java web-services soap websphere

调用网络服务时出现以下错误。只说它在eclipse上运行时与tomcat一起工作很好。但是在Websphere Application Server 9.0上使用时出错。在WAS9上运行时,我还有什么需要注意的。

这是我的代码:

SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapConnectionFactory.createConnection();
SOAPMessage soapResponse = soapConnection.call(soapRequestMessage, Url);

日志:

javax.xml.soap.SOAPException: 
java.lang.reflect.InvocationTargetException
at com.ibm.ws.webservices.engine.soap.SOAPConnectionImpl.callJAXWSDispatch(SOAPConnectionImpl.java:421)
at com.ibm.ws.webservices.engine.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:192)
at com.ibm.ws.webservices.engine.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:163)
at com.service.ClientService.callSoapWebService(ClientService.java:46)

1 个答案:

答案 0 :(得分:0)

经过大量搜索和调查,我找到了以下解决方案。

当前,IBM Business Process Manager Advanced,WebSphere Process Server和WebSphere Enterprise Service Bus不支持SOAP 1.2协议。请使用受支持的SOAP协议,例如SOAP 1.1。

对于SOAP1.1,请使用以下命令: soapenv:信封xmlns:soapenv =“ http://schemas.xmlsoap.org/soap/envelope/”