Lius
2025-03-03 5ae1b71ab6b57140d46e6a8b9e606bb4a390ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.jeecg.modules.mdc.config;
 
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.jeecg.modules.mdc.webservice.EquipmentWebService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
import javax.xml.ws.Endpoint;
 
/**
 * @Author hweiyu
 * @Description
 * @Date 2021/4/21 17:55
 */
@Configuration
public class WebServiceConfig {
 
    /**
     * Bus交由spring管理
     * @return
     */
    @Bean(name = Bus.DEFAULT_BUS_ID)
    public SpringBus springBus() {
        return new SpringBus();
    }
 
 
    /**
     * 服务地址:
     * http://localhost:9999/services
     * http://localhost:9999/services/EquipmentWebService?wsdl
     * @param equipmentWebService
     * @return
     */
    @Bean
    public Endpoint endpoint(EquipmentWebService equipmentWebService) {
        EndpointImpl endpoint = new EndpointImpl(springBus(), equipmentWebService);
        endpoint.publish("/EquipmentWebService");
        return endpoint;
    }
}