我试图发布该服务,但是该服务将SOAP生成EndPoint,因此我需要它是REST类型。
通常在xml文件中进行配置。但是我正在使用spring-boot
@Configuration
@ImportResource({ "classpath:META-INF/cxf/cxf.xml" , "classpath:META-INF/cxf/cxf-servlet.xml" })
public class EndpointConfig{
@Bean
public ServletRegistrationBean<CXFServlet> servletRegistrationBean(ApplicationContext context) {
return new ServletRegistrationBean<CXFServlet>(new CXFServlet(), "/api/*");
}
@Autowired
private Bus bus;
@Bean
public Endpoint endpoint() {
EndpointImpl endpoint =
new EndpointImpl(bus, new confeccionesRest());
endpoint.publish("/confeccionesRest");
return endpoint;
}
}
现在:http://localhost:8080/api/confeccionesRest?wsdl 预期:http://localhost:8080/api/confeccionesRest?wadl