-
Notifications
You must be signed in to change notification settings - Fork 175
/
spring-cxf-servlet.xml
65 lines (53 loc) · 2.6 KB
/
spring-cxf-servlet.xml
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
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean id="helloWorldBean" class="com.fengjing.framework.webservice.cxf.impl.HelloWorldImpl"></bean>
<bean id="outLoggingInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
<bean id="inLoggingInInterceptor" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
<!-- 使用jaxws:endpoint发布webservice -->
<!-- <jaxws:endpoint id="helloWorldService" implementor="#helloWorldBean" address="/HelloWorldService"/> -->
<!-- 使用jaxws:server发布webservice -->
<jaxws:server id="helloWorldService" serviceClass="com.fengjing.framework.webservice.cxf.HelloWorld" address="/HelloWorldService">
<jaxws:serviceBean>
<!-- 要暴露的 bean 的引用 -->
<ref bean="helloWorldBean"/>
</jaxws:serviceBean>
<jaxws:inInterceptors>
<ref bean="inLoggingInInterceptor"/>
</jaxws:inInterceptors>
<jaxws:outInterceptors>
<ref bean="outLoggingInterceptor"/>
</jaxws:outInterceptors>
</jaxws:server>
<!-- 通过 jaxws:client方式注入client-->
<!--
<jaxws:client
id="helloClient"
serviceClass="com.fengjing.framework.webservice.cxf.HelloWorld"
address="http://localhost:8080/maven-framework/ws/HelloWorldService?wsdl" />
-->
<!-- 通过 JaxWsProxyFactoryBean方式注入client-->
<bean id="helloClient" class="com.fengjing.framework.webservice.cxf.HelloWorld"
factory-bean="clientFactory" factory-method="create"/>
<bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
<property name="serviceClass" value="com.fengjing.framework.webservice.cxf.HelloWorld"/>
<property name="address" value="http://localhost:8080/maven-framework/ws/HelloWorldService"/>
<property name="inInterceptors">
<list>
<ref bean="inLoggingInInterceptor"/>
</list>
</property>
<property name="outInterceptors">
<list>
<ref bean="outLoggingInterceptor"/>
</list>
</property>
</bean>
</beans>