title: Spring WS with webServiceTemplate.marshalSendAndReceive returns Received error for request, Service Unavailable : Not Found [404]
body: <p>I'm trying to ammend an existing SOAP Webservice that uses Spring-WS and JAXB on Tomcat. I've created the new WAR file with my changes and deployed it in the webapps foder under Tomcat installation. </p>
  
  <p>When calling the original (already existing) methods of the service, the service SOAP request and response is fine. But when calling the service on the new method, I get  service SOAP response of service unavailable and not found [404]</p>
  
  <pre><code>2011-07-25 12:58:23,365 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Opening [org.springframework.ws.transport.http.HttpUrlConnection@12b9f14] to [http://&lt;service URL&gt;]
  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 [&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;SOAP-ENV:Header/&gt;&lt;SOAP-ENV:Body&gt;&lt;ns2:DelRequest xmlns:ns2="http://&lt;changed_address&gt;"&gt;&lt;ns2:userId&gt;ncc1@%&lt;/ns2:userId&gt;&lt;ns2:dateFromMillis&gt;1308956400000&lt;/ns2:dateFromMillis&gt;&lt;ns2:dateToMillis&gt;1311634800000&lt;/ns2:dateToMillis&gt;&lt;/ns2:DelRequest&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;]
  2011-07-25 12:58:25,318 DEBUG [org.springframework.ws.client.core.WebServiceTemplate] - Received error for request [SaajSoapMessage {http://&lt;changed_address&gt;}DelRequest]
  </code></pre>
  
  <p>2011-07-25 12:58:25,318 ERROR [net.msgplugin.controller.DeleteController] - Conversation service unavailable at: http://, Not Found [404] , null</p>
  
  <p>I've imported the project into Eclipse and have made the following changes to the project properties: </p>
  
  <p>1) With in Project Facets, I've checked the 'Dynamic Web Module' and 'Java' Facets.
  2) In Java EE Module Dependencies, I've checked Maven Dependencies. </p>
  
  <p>Two things which are to be noted here are: </p>
  
  <p>a) The developer was using JBoss when developing the Webservice but recently the project was chagned to Tomcat.
  b) The project has a MAVEN folder structure, hence the web.xml file is in src/main/webapp/WEB-INF folder rather than WebContent/WEB-INF, taht got created when I selected the 'Dynamic Web Module' facet. </p>
  
  <p>Any suggestions wld be hugely appreciated?</p>
  
  <p>Thanks</p>
  
  <p>========================================================================</p>
  
  <p>HI</p>
  
  <p>I managed to fix the Not Found [404] error but am now getting another error. 
  Upon further investigation and debuggin into WebServiceTemplate and MessageDispatcher classes, I found that following output on the console:</p>
  
  <pre><code>DEBUG [org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter] - Accepting incoming [org.springframework.ws.transport.http.HttpServletConnection@11f05a1] to [http://&lt;Service_URL&gt;]
  
  TRACE [org.springframework.ws.server.MessageTracing.received] - Received request [&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;SOAP-ENV:Header/&gt;&lt;SOAP-ENV:Body&gt;&lt;ns2:DelRequest xmlns:ns2="http://&lt;changed_address&gt;"&gt;&lt;ns2:userId&gt;ncc1@%&lt;/ns2:userId&gt;&lt;ns2:dateFromMillis&gt;1309042800000&lt;/ns2:dateFromMillis&gt;&lt;ns2:dateToMillis&gt;1311721200000&lt;/ns2:dateToMillis&gt;&lt;/ns2:DelRequest&gt;&lt;/SOAP-ENV:Body&gt;&lt;/SOAP-ENV:Envelope&gt;]
  
  DEBUG [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping] - Looking up endpoint for [{&lt;changed_address&gt;}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]
  </code></pre>
  
  <p>The end error message is now 'Argument type Mismatch' which I found was generated from one of the methods from within WebServiceTemplate.class</p>
  
  <p>Can somebody suggest what coudl be the problem here?</p>