-1

我正在尝试修改在 Tomcat 上使用 Spring-WS 和 JAXB 的现有 SOAP Web 服务。我已经使用我的更改创建了新的 WAR 文件,并将其部署在 Tomcat 安装下的 webapps 目录中。

当调用服务的原始(已经存在的)方法时,服务 SOAP 请求和响应就可以了。但是在新方法上调用服务时,我得到服务不可用且未找到的服务 SOAP 响应 [404]

2011-07-25 12:58:23,365 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Opening [org.springframework.ws.transport.http.HttpUrlConnection@12b9f14] to [http://<service URL>]
2011-07-25 12:58:23,521 DEBUG [org.springframework.ws.soap.saaj.support.SaajUtils] - SOAPElement [com.sun.xml.internal.messaging.saaj.soap.ver1_1.Envelope1_1Impl] implements SAAJ 1.3
2011-07-25 12:58:23,552 DEBUG [org.springframework.ws.soap.saaj.support.SaajUtils] - SOAPElement [com.sun.xml.internal.messaging.saaj.soap.ver1_1.Body1_1Impl] implements SAAJ 1.3
2011-07-25 12:58:23,896 DEBUG [org.springframework.ws.client.MessageTracing.sent] - Sent request [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:DelRequest xmlns:ns2="http://<changed_address>"><ns2:userId>ncc1@%</ns2:userId><ns2:dateFromMillis>1308956400000</ns2:dateFromMillis><ns2:dateToMillis>1311634800000</ns2:dateToMillis></ns2:DelRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]
2011-07-25 12:58:25,318 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Received error for request [SaajSoapMessage {http://<changed_address>}DelRequest]

2011-07-25 12:58:25,318 错误 [net.msgplugin.controller.DeleteController] - 会话服务在:http:// 不可用,未找到 [404],空

我已将项目导入 Eclipse,并对项目属性进行了以下更改:

1) 在 Project Facets 中,我检查了“动态 Web 模块”和“Java”方面。2) 在 Java EE Module Dependencies 中,我检查了 Maven Dependencies。

这里需要注意的两点是:

a) 开发者在开发 Webservice 时使用的是 JBoss,但最近该项目被更改为 Tomcat。b) 该项目具有 MAVEN 文件夹结构,因此 web.xml 文件位于 src/main/webapp/WEB-INF 文件夹中,而不是 WebContent/WEB-INF 中,当我选择“动态 Web 模块”方面时创建了该文件。

任何建议将不胜感激?

谢谢

==================================================== =======================

你好

我设法修复了 Not Found [404] 错误,但现在又遇到了另一个错误。在进一步调查和调试 WebServiceTemplate 和 MessageDispatcher 类后,我发现控制台上的输出如下:

DEBUG [org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter] - Accepting incoming [org.springframework.ws.transport.http.HttpServletConnection@11f05a1] to [http://<Service_URL>]

TRACE [org.springframework.ws.server.MessageTracing.received] - Received request [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:DelRequest xmlns:ns2="http://<changed_address>"><ns2:userId>ncc1@%</ns2:userId><ns2:dateFromMillis>1309042800000</ns2:dateFromMillis><ns2:dateToMillis>1311721200000</ns2:dateToMillis></ns2:DelRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]

DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] - Looking up endpoint for [{<changed_address>}DelRequest]

DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping@6ee035] maps request to endpoint [public final net.org.messagehistory.schema.GetDelResponse net.org.messagehistory.service.endpoint.MessageHistoryEndpoint.delHistory(net.org.messagehistory.schema.GetListRequest) throws javax.xml.datatype.DatatypeConfigurationException]

DEBUG [org.springframework.ws.soap.server.SoapMessageDispatcher] - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter@1a23f67]

DEBUG [org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter] - Unmarshalled payload request to [net.org.messagehistory.schema.DelRequest@c76003]

最终错误消息现在是“参数类型不匹配”,我发现它是由 WebServiceTemplate.class 中的一种方法生成的

有人可以建议这里有什么问题吗?

4

1 回答 1

0

设法得到这个排序。所以,只是想分享一些人可能会觉得有帮助的解决方案。

确保使用以下 @PayloadRoot(localPart = MESSAGES_TO_DELETE, namespace = MESSAGE_NAMESPACE) 注释 Endpoint 方法,其中 localpart 与 schema.xsd 中的有效负载请求相同

谢谢

于 2011-07-29T09:35:01.213 回答