我正在尝试向SoapUI工具发送Web服务的soap请求并收到以下错误:
12/10/17 09:00:33 java.lang.ClassCastException: com.sun.xml.messaging.saaj.soap.impl.TextImpl
12/10/17 09:00:33 at br.gov.suframa.pmn.webservices.handler.SegurancaHandler.validarEntrada(SegurancaHandler.java:161)
12/10/17 09:00:33 at br.gov.suframa.pmn.webservices.handler.SegurancaHandler.handleMessage(SegurancaHandler.java:74)
12/10/17 09:00:33 at br.gov.suframa.pmn.webservices.handler.SegurancaHandler.handleMessage(SegurancaHandler.java:33)
12/10/17 09:00:33 at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:292)
12/10/17 09:00:33 at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:135)
12/10/17 09:00:33 at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnRequest(ServerSOAPHandlerTube.java:134)
12/10/17 09:00:33 at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:116)
12/10/17 09:00:33 at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
12/10/17 09:00:33 at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
12/10/17 09:00:33 at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
12/10/17 09:00:33 at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
12/10/17 09:00:33 at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
12/10/17 09:00:33 at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)
12/10/17 09:00:33 at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
12/10/17 09:00:33 at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:136)
12/10/17 09:00:33 at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
12/10/17 09:00:33 at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:161)
12/10/17 09:00:33 at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
12/10/17 09:00:33 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
12/10/17 09:00:33 at javax.servlet.http.HttpServlet.service(HttpServlet.java:857)
12/10/17 09:00:33 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
12/10/17 09:00:33 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
12/10/17 09:00:33 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
12/10/17 09:00:33 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
12/10/17 09:00:33 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
12/10/17 09:00:33 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
12/10/17 09:00:33 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
12/10/17 09:00:33 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
12/10/17 09:00:33 at java.lang.Thread.run(Thread.java:595)
我已经阅读了几个有关此问题的帖子,但没有人明确提供解决方案。我尝试按照这篇文章的提示:Exception occurs with JAX-RPC handler 但我只有一个lib“saaj-api-1.3.jar”,其中包含“SOAPElement.class”,并且没有其他lib与此类。
我需要添加任何罐子吗?有人可以帮我解决这个问题吗?
我从eclipse和JRE 1.5.0_24运行这个程序作为Java应用程序。
**** ** UPDATE 我注意到在soapUI中,我尝试使用参数发送一个格式良好的xml,当我调试时,我发现在SOAP请求中发送了一个“\ n”而不是内容。我想传递一个xml参数。
有人有同样的情况吗?**
答案 0 :(得分:0)
从soapui中删除xml请求中的所有空格,它将起作用。