我有一个Spring WS,我可以成功调用2个请求。这是输出:
2011-07-20 18:25:33,743 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Opening [org.springframework.ws.transport.http.HttpUrlConnection@1696452] to [http://mymachine:8080/test-service/HistoryService]
2011-07-20 18:25:33,868 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-20 18:25:33,900 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-20 18:25:34,259 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:GetListRequest xmlns:ns2="http://address_changed"><ns2:userId>ncc1@%</ns2:userId><ns2:dateFromMillis>1308524400000</ns2:dateFromMillis><ns2:dateToMillis>1311202800000</ns2:dateToMillis></ns2:GetListRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]
2011-07-20 18:25:36,728 DEBUG [org.springframework.ws.client.MessageTracing.received] - Received response [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:GetListResponse xmlns:ns2="address_changed"><ns2:conversations><ns2:conversationID>1</ns2:conversationID><ns2:conversationStartDate>2011-06-30T10:37:53.964+01:00</ns2:conversationStartDate><ns2:conversationEndDate>2011-06-30T10:37:58.543+01:00</ns2:conversationEndDate><ns2:participants>usr1</ns2:participants><ns2:participants>usr1</ns2:participants></ns2:conversations></ns2:GetListResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>] for request [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns2:GetListRequest xmlns:ns2="address_changed"><ns2:userId>ncc1@%</ns2:userId><ns2:dateFromMillis>1308524400000</ns2:dateFromMillis><ns2:dateToMillis>1311202800000</ns2:dateToMillis></ns2:GetListRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>]
但是当对新创建的方法进行请求调用时,我收到一个错误,即服务不可用,尽管该服务可用于其他(最初存在的)方法调用。输出是:
2011-07-20 18:25:53,166 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Opening [org.springframework.ws.transport.http.HttpUrlConnection@1f2e95f] to [http://mymachine:8080/test-service/HistoryService]
2011-07-20 18:25:53,166 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:DelConversationListRequest xmlns:ns2="http://astrium.eads.net/eow"><ns2:userId>ncc1@%</ns2:userId><ns2:dateFromMillis>1308524400000</ns2:dateFromMillis><ns2:dateToMillis>1311202800000</ns2:dateToMillis></ns2:DelConversationListRequest></SOAP-ENV:Body></SOAP- ENV:Envelope>]
2011-07-20 18:25:53,181 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Received error for request [SaajSoapMessage {http://changedAddress}DelConversationListRequest]
2011-07-20 18:25:53,197 ERROR [net.org.controller.GetConvController] - Service unavailable at: http://mymachine:8080/test-service/HistoryService, Not Found [404]
请建议。
答案 0 :(得分:0)
管理以解决此问题。问题是我在Tomcat(webapps文件夹)中部署的WAR文件不包含最新的代码更改和主项目POM文件。
要在Eclipse IDE中包含MAVEN目录, 右键单击WS项目 - &gt;属性 - &gt; Java EE模块依赖关系 - &gt;检查Maven Dependencies复选框。然后重建项目并在Tomcat中重新部署WAR文件。现在,这将包括POM文件以及其他MAVEN依赖项。