title: Build a WS with Spring
body: <p>I need to create a WS with Spring 3.0.4.RELEASE to run in a Tomcat with Axis2. I'm following this doc: <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/remoting.html#remoting-web-services-jaxws-export-ri" rel="nofollow">http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/remoting.html#remoting-web-services-jaxws-export-ri</a> (if that paragraph can be called "doc")  </p>
  
  <p>Ok, here are the details:</p>
  
  <p>The java class:</p>
  
  <pre><code>package foo;
  @WebService(serviceName="MyService")
  public class MyService{
    @WebMethod  
    public String getString(){
      return "Hello StackOverflow";
    }  
  }  
  </code></pre>
  
  <p>The WEB-INF/spring-ws.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ws="http://jax-ws.dev.java.net/spring/core"
  xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
      http://jax-ws.dev.java.net/spring/core https://jax-ws.dev.java.net/spring/core.xsd  
      http://jax-ws.dev.java.net/spring/servlet https://jax-ws.dev.java.net/spring/servlet.xsd"&gt;
  
    &lt;wss:binding url="/myService" service="#myService" /&gt;
  
    &lt;ws:service id="myService"
      impl="foo.MyService" /&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>The WEB-INF/web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="myService" version="2.4"
  xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
  &lt;display-name&gt;my Service&lt;/display-name&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/spring-ws.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;!-- this is for Spring --&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;!-- these are for JAX-WS --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;jaxws-servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSSpringServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;jaxws-servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/myService&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p></p>
  
  <p>And last, but not less important, the <strong>error</strong> when I <strong>start tomcat 6.0.29</strong>:</p>
  
  <pre><code>Context initialization failed
  org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://jax-ws.dev.java.net/spring/servlet]
  Offending resource: ServletContext resource [/WEB-INF/spring-ws.xml]  
  </code></pre>
  
  <p>Someone has any clue of what is happening? Is all the configuration correct? Does anyone have a simple (working) WS to show how to deploy a WS using Spring?</p>
  
  <p>Thanks in advance</p>