Spring WS unavailable upon requesting connection

不问归期 提交于 2020-01-07 02:22:11

问题


I've got a Spring WS which I'm able to call successfully for 2 requests. Here is the output:

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>] 

But when making a request call to a newly created method, I get an error that Service is not available, although the service is available for other (originally present) method calls. The output is:

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]

Please suggest.


回答1:


Managed to get this issue resolved. The problem was that the WAR file that I was deploying in the Tomcat (webapps folder) did not contain the latest code changes and the main project POM file.

To include the MAVEN directories, in Eclipse IDE, Right click on the WS project --> Properties --> Java EE Module Dependencies --> check the Maven Dependencies checkbox. Then rebuild your project and re-deploy the WAR file in Tomcat. This will now include the POM file along with other MAVEN Dependencies.



来源:https://stackoverflow.com/questions/6766328/spring-ws-unavailable-upon-requesting-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!