CxfConfig.java
2.79 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package com.huaheng.framework.config;
import com.huaheng.api.erp.server.*;
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.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;
/**
* @ClassName CxfConfig
* @Description TODO
* @Author Administrator
* @Date 2020/10/1214:11
*/
@Configuration
public class CxfConfig {
private static final int LOG_LIMIT = 1;
//本地wsdld服务端地址
public static String wsdlUrl = "http://localhost:8888/wms/webService/shipment?wsdl";
public static String taskwsdlUrl = "http://localhost:8888/wms/webService/assignTask?wsdl";
//对方wsdl地址
//public static String wsdlUrl = "http://";
//ESB
//public static String wsdlUrl = "http://";
@Bean
public ServletRegistrationBean webServlet(){
return new ServletRegistrationBean(new CXFServlet(),"/webService/*");//发布服务名称
}
@Bean(name = Bus.DEFAULT_BUS_ID)
public SpringBus springBus()
{
return new SpringBus();
}
@Bean
public ShipmentItemReceive shipmentItemReceive()
{
return new ShipmentItemReceiveImpl();
}
@Bean
public TaskReceive taskReceive()
{
return new TaskReceiveImpl();
}
@Bean
public BackDomainServiceImpl backDomainService()
{
return new BackDomainServiceImpl();
}
@Bean
public Endpoint endpoint() {
EndpointImpl endpoint=new EndpointImpl(springBus(), shipmentItemReceive());
endpoint.publish("/shipment");
return endpoint;
}
@Bean
public Endpoint endpoint2() {
EndpointImpl endpoint=new EndpointImpl(springBus(), taskReceive());
endpoint.publish("/assignTask");
return endpoint;
}
@Bean
public Endpoint endpoints() {
EndpointImpl endpoint=new EndpointImpl(springBus(), backDomainService());
endpoint.publish("/lackMat");
return endpoint;
}
/**
* @description 启用日志记录
* @author fg
* @date 2019年1月11日
*/
// @Bean(name = Bus.DEFAULT_BUS_ID)
// public SpringBus springBus() {
// SpringBus springBus = new SpringBus();
// LoggingInInterceptor ipt = new LoggingInInterceptor();
// LoggingOutInterceptor opt = new LoggingOutInterceptor();
// ipt.setPrettyLogging(true);
// ipt.setLimit(LOG_LIMIT);
// opt.setPrettyLogging(true);
// opt.setLimit(LOG_LIMIT);
// springBus.getInInterceptors().add(ipt);
// springBus.getOutInterceptors().add(opt);
// return springBus;
// }
}