I have some legacy JAX-WS @WebService annotated classes. I am trying to get this working in spring-boot. Been looking at https://jax-ws-commons.java.net/spring/ as a reference as well as http://docs.spring.io/spring/docs/current/spring-framework-reference/html/remoting.html.
My @SpringBootAnnotated class
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class SpringBootBooter extends SpringBootServletInitializer {
@Bean
public ServletRegistrationBean servletRegistrationBean() {
ServletRegistrationBean reg = new ServletRegistrationBean(new WSSpringServlet(),"/myws");
reg.setLoadOnStartup(1);
return reg;
}
public static void main(String args[]) throws Exception {
SpringApplication.run(new Object[] {
SpringBootBooter.class,
new ClassPathResource("myLegacyAppContextWithWSBean.xml")
}, args);
}
@Override
public void onStartup(final ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
servletContext.addListener(new WSServletContextListener());
}
}
My XML config for the WS implementation class
<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-3.1.xsd
http://jax-ws.dev.java.net/spring/core
http://jax-ws.java.net/spring/core.xsd
http://jax-ws.dev.java.net/spring/servlet
http://jax-ws.java.net/spring/servlet.xsd">
<wss:binding url="/myws">
<wss:service>
<ws:service bean="#mywsbean" />
</wss:service>
</wss:binding>
<bean id="mywsbean" class="com.items.MyWsBean">
</bean>
</beans>
When everything boots up, I go to localhost:8080/myws and just get back "404 Not Found: Invalid Request".
Just not sure what I am missing, its like something is not parsing those wss:binding XML declarations to tie together these servlet requests to the bean, and I am not sure how to do this in spring-boot.
This appears in logs when I first hit that mapped URI
Jul 15, 2015 9:40:18 AM com.sun.xml.ws.transport.http.servlet.WSServletDelegate <init>
INFO: WSSERVLET14: JAX-WS servlet initializing
thanks