0

我正在尝试向 SoapUI 工具发送 Web 服务的肥皂请求并收到以下错误:

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)

我已经阅读了有关此问题的几篇文章,但没有人明确提供解决方案。我尝试遵循这篇文章的提示:JAX-RPC 处理程序发生异常, 但我只有一个包含“SOAPElement.class”的库“saaj-api-1.3.jar”,并且没有其他包含此类的库。

我需要添加任何罐子吗?有人可以帮我解决这个问题吗?

我在 Eclipse 和 JRE 1.5.0_24 上将这个程序作为 Java 应用程序运行。

****更新** 我在soapUI中注意到,我尝试发送一个格式良好的带有参数的xml,当我调试时,我发现在SOAP请求中发送的是一个“\ n”而不是一个内容。我想传递一个 xml 参数。

有人有同样的情况吗?**

4

1 回答 1

0

从soapui的xml请求中删除所有空格,它将起作用。

于 2013-05-17T14:32:21.247 回答