| | |
| | | import org.apache.cxf.jaxws.EndpointImpl; |
| | | import org.apache.cxf.transport.servlet.CXFServlet; |
| | | import org.jeecg.modules.wms.service.ReceiveWMSScanItemListService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.jeecg.modules.wms.service.impl.ReceiveWMSScanItemListServiceImpl; |
| | | import org.springframework.boot.web.servlet.ServletRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | |
| | | @Configuration |
| | | public class WebServiceServerConfig { |
| | | @Autowired |
| | | private ReceiveWMSScanItemListService receiveWMSScanItemListService; |
| | | |
| | | @Bean(name = "cxfServer") |
| | | @Bean(name = Bus.DEFAULT_BUS_ID) |
| | | public Bus springBus() { |
| | | return new SpringBus(); |
| | | } |
| | | |
| | | @Bean(name = "cxfServlet") // 注入servlet bean name不能dispatcherServlet ,否则会覆盖dispatcherServlet |
| | | public ServletRegistrationBean<CXFServlet> cxfServlet() { |
| | | return new ServletRegistrationBean<CXFServlet>(new CXFServlet(), "/webservice/*"); |
| | | return new ServletRegistrationBean<>(new CXFServlet(), "/webservice/*"); |
| | | } |
| | | |
| | | @Bean |
| | | public ReceiveWMSScanItemListService receiveWMSScanItemListService() { |
| | | return new ReceiveWMSScanItemListServiceImpl(); |
| | | } |
| | | |
| | | @Bean |
| | | public Endpoint endpoint() { |
| | | // 参数二,是SEI实现类对象 |
| | | Endpoint endpoint = new EndpointImpl(this.springBus(), receiveWMSScanItemListService); |
| | | Endpoint endpoint = new EndpointImpl(this.springBus(), this.receiveWMSScanItemListService()); |
| | | // 发布服务 |
| | | endpoint.publish("/userService"); |
| | | endpoint.publish("/ReceiveWMSScanItemList"); |
| | | return endpoint; |
| | | } |
| | | } |