我在 RAD 8 和 Websphere v7 上使用 JAX-WS 创建了 Web 服务。我使用 ProtocolHandler 制作了处理程序来操作 SOAP 消息。
在 handleMessage(SOAPMessageContext) 方法中,我调用了 getMessage() 来获取 SOAP 消息。我不能。这是我的代码
public boolean handleMessage(SOAPMessageContext context) {
try {
SOAPMessage soapMessage = context.getMessage(); // getMessage() always cause the error
SOAPPart soapPart = soapMessage.getSOAPPart();
SOAPEnvelope soapEnvelope= soapPart.getEnvelope();
} catch (SOAPException e) {
System.out.println("SOAPException");
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
我总是得到下面的错误。看来这个问题与 SAAJ 库有关。但据我所知,我不明白 IBM JDK 有 SAAJ 实现的类。而且......上面的代码两天前工作了。之后,它不起作用。
所以我删除了所有的项目文件并创建了新的动态 web 项目来检查它是否工作。它不起作用...
有人知道解决方案吗?还是有同样的问题?
[13. 7. 4 21:16:41:028 KST] 0000001c SystemErr R javax.xml.ws.WebServiceException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
[13. 7. 4 21:16:41:028 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
[13. 7. 4 21:16:41:028 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.message.impl.MessageImpl.getAsSOAPMessage(MessageImpl.java:344)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.handler.SoapMessageContext.getMessage(SoapMessageContext.java:183)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at com.koreanair.naora.xml.handler.RAAWPID01ServicesProtocolHandler.handleMessage(RAAWPID01ServicesProtocolHandler.java:28)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at com.koreanair.naora.xml.handler.RAAWPID01ServicesProtocolHandler.handleMessage(RAAWPID01ServicesProtocolHandler.java:1)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.handler.HandlerChainProcessor.callHandleMessageWithTracker(HandlerChainProcessor.java:871)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.handler.HandlerChainProcessor.handleMessage(HandlerChainProcessor.java:516)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.handler.HandlerChainProcessor.callGenericHandlers(HandlerChainProcessor.java:289)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.handler.HandlerChainProcessor.processChain(HandlerChainProcessor.java:232)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.handler.HandlerInvokerUtils.invokeInboundHandlers(HandlerInvokerUtils.java:65)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.handler.impl.HandlerInvokerImpl.invokeInboundHandlers(HandlerInvokerImpl.java:37)
[13. 7. 4 21:16:41:029 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.server.EndpointController.inboundHeaderAndHandlerProcessing(EndpointController.java:348)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.server.EndpointController.handleRequest(EndpointController.java:260)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.server.EndpointController.invoke(EndpointController.java:103)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.server.JAXWSMessageReceiver.receive(JAXWSMessageReceiver.java:161)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:189)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at com.ibm.ws.websvcs.transport.http.WASAxis2Servlet.doPost(WASAxis2Servlet.java:1442)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:944)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:507)
[13. 7. 4 21:16:41:030 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3954)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:945)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:191)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[13. 7. 4 21:16:41:031 KST] 0000001c SystemErr R at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[13. 7. 4 21:16:41:056 KST] 0000001c SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
[13. 7. 4 21:16:41:056 KST] 0000001c SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[13. 7. 4 21:16:41:056 KST] 0000001c SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[13. 7. 4 21:16:41:056 KST] 0000001c SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[13. 7. 4 21:16:41:056 KST] 0000001c SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1656)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.sun.xml.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:536)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:316)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:74)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at org.apache.axis2.jaxws.message.impl.MessageImpl.getAsSOAPMessage(MessageImpl.java:285)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R ... 41 more
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R Caused by: java.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/SOAPDocumentImpl
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:106)
[13. 7. 4 21:16:41:057 KST] 0000001c SystemErr R at com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.getSOAPPart(Message1_1Impl.java:90)
[13. 7. 4 21:16:41:058 KST] 0000001c SystemErr R at com.sun.xml.messaging.saaj.soap.MessageImpl.initCharsetProperty(MessageImpl.java:1441)
[13. 7. 4 21:16:41:058 KST] 0000001c SystemErr R at com.sun.xml.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:406)
[13. 7. 4 21:16:41:058 KST] 0000001c SystemErr R ... 44 more