You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB
Java

2 years ago
package com.docus.server;
import com.docus.server.report.webservice.IReportServer;
import org.apache.cxf.jaxws.EndpointImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.transport.servlet.CXFServlet;
import javax.xml.ws.Endpoint;
@Configuration
@RequiredArgsConstructor
public class CxfConfig {
private final IReportServer reportServer;
/**
* ServletbeanNamedispatcherServlet
* @author Fang Ruichuan
* @date 2022/11/14 19:16
*/
@Bean
public ServletRegistrationBean cxfServlet() {
return new ServletRegistrationBean(new CXFServlet(), "/webservice/*");
}
@Bean(name = Bus.DEFAULT_BUS_ID)
public SpringBus springBus() {
return new SpringBus();
}
@Bean
@Qualifier("reportEndPoint")
public Endpoint userEndPoint() {
EndpointImpl endpoint = new EndpointImpl(springBus(), reportServer);
endpoint.publish("/api/report");
return endpoint;
}
}