JAX-WS Spring Integration
JAX-WS with Spring Tutorial :
JAX-WS web service can be easily integrated with spring and provide high interoperability. Spring provides remoting support for web services via JAX-WS .This Spring allows youconfigure various aspects such as the use of MTOM, handlers, custom transports, encoding.
Spring Context File :
<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-2.5.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.dev.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
http://jax-ws.dev.java.net/spring/servlet.xsd ">
<wss:binding url="/aa/xyz">
<wss:service>
<ws:service bean="beanName" />
</wss:service>
</wss:binding>
<bean id="beanName" class="com.prj.example.ServiceImpl" autowire="byName">
Web.xml Configration : Service class used for Spring integartion in web.
<servlet>
<servlet-name>service</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
Web Service Implementation Class :
@WebService(serviceName="service",targetNamespace="http://www.example.com/aa/xyz")
public class ServiceImpl implements IServiceImpl
{
@WebMethod
public Object myMethod(
{
}
}