Skip to content

Instantly share code, notes, and snippets.

@zeroows
Last active August 29, 2015 14:23
Show Gist options
  • Save zeroows/84281b31dcfc98b88cbf to your computer and use it in GitHub Desktop.
Save zeroows/84281b31dcfc98b88cbf to your computer and use it in GitHub Desktop.
Defining CXF endpoint in JavaConfig spring boot
/**
* To enable web services of Apache CXF
*/
@Configuration
@ImportResource({"classpath:META-INF/cxf/cxf.xml"})
protected static class CXFConfiguration {
@Autowired
private Bus cxfBus;
@Bean
public Endpoint endpoint() {
Endpoint endpoint = new EndpointImpl(cxfBus, new NotificationImpl());
endpoint.publish("/Notification");
return endpoint;
}
@Bean
public ServletRegistrationBean webservices() {
final ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new CXFServlet(),"/ws/*");
servletRegistrationBean.setLoadOnStartup(1);
return servletRegistrationBean;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment