I am attempting to get CXF and Sprint Boot to play nicely. I have a JAX-WS service endpoint called SubscriberApi. Looking at the spring-boot logs I see successful mapping:
Mapping servlet: 'CXFServlet' to [/api/*]
Setting the server's publish address to be /SubscriberApi
However, I cant seem to get the WSDL when hitting:
http://localhost:8080/api/SubscriberApi?wsdl
@Configuration
@ImportResource({"classpath:META-INF/cxf/cxf.xml"})
public class CxfConfiguration {
@Bean
public SubscriberApi subscriberApi() {
return new SubscriberApi();
}
@Bean
public ServletRegistrationBean servletRegistrationBean() {
CXFServlet cxfServlet = new CXFServlet();
ServletRegistrationBean servletRegistrationBean =
new ServletRegistrationBean(cxfServlet, "/api/*");
servletRegistrationBean.setLoadOnStartup(1);
return servletRegistrationBean;
}
@DependsOn("servletRegistrationBean")
@Bean
public Endpoint jaxwsEndpoint(SubscriberApi subscriberApi){
javax.xml.ws.Endpoint jaxwsEndpoint =
javax.xml.ws.Endpoint.publish("/SubscriberApi", subscriberApi);
return jaxwsEndpoint;
}
}
cxf-spring-boot-starter-jaxws
and codecentric'scxf-spring-boot-starter
? – Nablus