| | |
| | | package org.jeecg.modules.wms.config; |
| | | |
| | | import org.apache.cxf.Bus; |
| | | import org.apache.cxf.bus.spring.SpringBus; |
| | | import org.apache.cxf.jaxws.EndpointImpl; |
| | | import org.apache.cxf.transport.servlet.CXFServlet; |
| | | import org.jeecg.modules.wms.service.ReceiveWMSScanItemListService; |
| | | import org.jeecg.modules.wms.service.MESWebServiceSoap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.servlet.ServletRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | @Configuration |
| | | public class WebServiceServerConfig { |
| | | @Autowired |
| | | private ReceiveWMSScanItemListService receiveWMSScanItemListService; |
| | | |
| | | @Bean(name = "cxfServer") |
| | | public Bus springBus() { |
| | | return new SpringBus(); |
| | | } |
| | | private Bus bus; |
| | | @Autowired |
| | | private MESWebServiceSoap mesWebServiceSoap; |
| | | |
| | | @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 Endpoint endpoint() { |
| | | // 参数二,是SEI实现类对象 |
| | | Endpoint endpoint = new EndpointImpl(this.springBus(), receiveWMSScanItemListService); |
| | | Endpoint endpoint = new EndpointImpl(bus, mesWebServiceSoap); |
| | | // 发布服务 |
| | | endpoint.publish("/userService"); |
| | | endpoint.publish("/MESWebService"); |
| | | |
| | | return endpoint; |
| | | } |
| | | } |