Reputation: 1745
I have the following code and it doesn't work. CXF reports that no services are found and if I access it directly by http://domain:8080/api/cxf/LotService
, I get 'No service was found'. I'm using the latest CXF and Spring 4 in Tomcat.
@Configuration
@ImportResource({ "classpath:META-INF/cxf/cxf.xml" })
public class CXFConfiguration {
@Autowired
ILotService lotService;
@Bean
public Endpoint lotService() {
EndpointImpl endpoint = new EndpointImpl(SpringBusFactory.getDefaultBus(), lotService);
endpoint.setAddress("/LotService");
endpoint.publish();
return endpoint;
}
Upvotes: 0
Views: 3048
Reputation: 1745
The proper configuration is here
@Configuration
@Order(3)
@ImportResource({ "classpath:META-INF/cxf/cxf.xml" })
public class CXFConfiguration {
@Autowired
Bus cxfBus;
@Bean
public Endpoint lotServiceEndpointWS() {
EndpointImpl endpoint = new EndpointImpl(this.cxfBus,
new LotServiceEndpoint());
endpoint.setAddress("/LotService");
endpoint.publish();
return endpoint;
}
Upvotes: 1