Spring Webservice mit SimpleJaxWsServiceExporter

Basierend auf http://www.subshell.com/en/subshell/blog/article-Publishing-Webservices-with-Java-6-and-Spring-WS100.html ich versuche zu laufen Webservice mit SimpleJaxWsServiceExporter auf Tomcat 7.

localhost:8081/WSTest/TourWS?wsdl im browser den Fehler 404.

TourWS.java

@WebService
@SOAPBinding(style=Style.DOCUMENT)
public interface TourWS {
@WebMethod
public void declareTours(ArrayList<TourWSEntity> tours);
@WebMethod
public void declareTour(TourWSEntity tour);
@WebMethod
public String whoAmI();

}

TourWSImpl.java

@WebService(serviceName="TourWS")
public class TourWSImpl implements TourWS {
public TourWSImpl(){}

@Override
public void declareTours(ArrayList<TourWSEntity> tours) {
    //impl
}

@Override
public void declareTour(TourWSEntity tour) {
    //impl
}

@Override
public String whoAmI(){
    return "JAX-WS Web Service - TourWS";
}

spring-ws-servlet.xml

<beans ...>
<bean class="org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter">
    <property name="baseAddress" value="http://localhost:8081/" />
</bean>
<bean id="tourWSImpl" class="tour.spring.ws.impl.TourWSImpl" />
</beans>

web.xml

<web-app ...>
<servlet>
    <servlet-name>spring-ws</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>spring-ws</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>

pom.xml

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>2.0.5.RELEASE</version>
</dependency>

Ausgabe der Konsole:

2012-06-17 22:29:52 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk\bin;.;...
2012-06-17 22:29:52 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:WSSpring' did not find a matching property.
2012-06-17 22:29:52 org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
2012-06-17 22:29:52 org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
2012-06-17 22:29:52 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 572 ms
2012-06-17 22:29:52 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
2012-06-17 22:29:52 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.6
2012-06-17 22:29:53 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
2012-06-17 22:29:53 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
2012-06-17 22:29:53 org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
2012-06-17 22:29:53 org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
2012-06-17 22:29:53 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
2012-06-17 22:29:53 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
2012-06-17 22:29:53 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
2012-06-17 22:29:53 org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
2012-06-17 22:29:53 org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
2012-06-17 22:29:53 org.apache.catalina.startup.Catalina start
INFO: Server startup in 799 ms
2012-06-17 22:29:54 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'spring-ws'
2012-06-17 22:29:54 org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'spring-ws': initialization started
2012-06-17 22:29:54 org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'spring-ws-servlet': startup date [Sun Jun 17 22:29:54 CEST 2012]; root of context hierarchy
2012-06-17 22:29:54 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-ws-servlet.xml]
2012-06-17 22:29:55 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@3ca754: defining beans [org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter#0,tourWSImpl]; root of factory hierarchy
2012-06-17 22:29:55 com.sun.xml.internal.ws.model.RuntimeModeler getRequestWrapperClass
INFO: Dynamically creating request wrapper Class tour.spring.ws.impl.jaxws.DeclareTours
2012-06-17 22:29:55 com.sun.xml.internal.ws.model.RuntimeModeler getResponseWrapperClass
INFO: Dynamically creating response wrapper bean Class tour.spring.ws.impl.jaxws.DeclareToursResponse
2012-06-17 22:29:55 com.sun.xml.internal.ws.model.RuntimeModeler getRequestWrapperClass
INFO: Dynamically creating request wrapper Class tour.spring.ws.impl.jaxws.DeclareTour
2012-06-17 22:29:55 com.sun.xml.internal.ws.model.RuntimeModeler getResponseWrapperClass
INFO: Dynamically creating response wrapper bean Class tour.spring.ws.impl.jaxws.DeclareTourResponse
2012-06-17 22:29:55 com.sun.xml.internal.ws.model.RuntimeModeler getRequestWrapperClass
INFO: Dynamically creating request wrapper Class tour.spring.ws.impl.jaxws.WhoAmI
2012-06-17 22:29:55 com.sun.xml.internal.ws.model.RuntimeModeler getResponseWrapperClass
INFO: Dynamically creating response wrapper bean Class tour.spring.ws.impl.jaxws.WhoAmIResponse
2012-06-17 22:29:55 org.springframework.ws.soap.saaj.SaajSoapMessageFactory afterPropertiesSet
INFO: Creating SAAJ 1.3 MessageFactory with SOAP 1.1 Protocol
2012-06-17 22:29:55 org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'spring-ws': initialization completed in 1125 ms

Bitte, schlagen Sie mich, was falsch sein könnte.

InformationsquelleAutor LancerX | 2012-06-17
Schreibe einen Kommentar