title: WebServiceTransportException: Not Found [404]
body: <p>I'm currently implementing a spring web service using jaxb. But when I trying to consume the web service created a <code>WebServiceTransportException: Not Found [404]</code> error is encountered. I did try to search the net but could not able to find a possible root cause. Below I have show my source codes.</p>
  
  <p>application-context.xml
  
          
          
          
      </p>
  
  <pre><code>&lt;bean
      class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter"&gt;
      &lt;constructor-arg ref="marshaller" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"&gt;
      &lt;property name="classesToBeBound"&gt;
          &lt;list&gt;
              &lt;value&gt;com.ph.domain.EightBallRequest&lt;/value&gt;
              &lt;value&gt;com.ph.domain.EightBallResponse&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="prefix"&gt;
          &lt;value&gt;/jsp/&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="suffix"&gt;
          &lt;value&gt;.jsp&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="simpleUrlHandlerMapping"
      class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"
      lazy-init="true"&gt;
      &lt;property name="mappings"&gt;
          &lt;props&gt;
              &lt;prop key="/test.asp"&gt;LandingController&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;     
  
  &lt;bean name="LandingController" class="com.ph.controller.LandingController"&gt;
      &lt;property name="stub" ref="eightBallClient"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Client for webservice</p>
  
  <pre><code>public class EightBallClient extends WebServiceGatewaySupport {
  
  private Resource request;
  
  public void setRequest(Resource request) {
      this.request = request;
  }
  
  public String AskQuestion(String question) throws IOException {
      String responseString = null;
  
      EightBallRequest request = new EightBallRequest();
      request.setQuestion(question);
  
      EightBallResponse response = new EightBallResponse();
  
      response = (EightBallResponse) getWebServiceTemplate()
              .marshalSendAndReceive(request);
      responseString = response.getAnswer().toString();
      return responseString;
  }
  }
  </code></pre>
  
  <p>definition of my web service</p>
  
  <p>
          
          
          
          
      </p>
  
  <pre><code>&lt;bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema"&gt;
      &lt;property name="xsd" value="/WEB-INF/eightball.xsd" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>And below is the error stack:</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet dispatcher threw exception
  org.springframework.ws.client.WebServiceTransportException: Not Found [404]
      at org.springframework.ws.client.core.WebServiceTemplate.handleError(WebServiceTemplate.java:626)
      at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:550)
      at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:501)
      at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:350)
      at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:344)
      at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:336)
  </code></pre>