引入cxf
-
<dependency>
-
<groupId>org.apache.cxf</groupId>
-
<artifactId>cxf-rt-frontend-jaxws</artifactId>
-
<version>${cxf.version}</version>
-
</dependency>
-
<dependency>
-
<groupId>org.apache.cxf</groupId>
-
<artifactId>cxf-rt-transports-http</artifactId>
-
<version>${cxf.version}</version>
-
</dependency>
-
-
-
<!-- aegis数据绑定标准,暂时用不上 -->
-
<!-- <dependency>
-
<groupId>org.apache.cxf</groupId>
-
<artifactId>cxf-rt-databinding-aegis</artifactId>
-
<version>${cxf.version}</version>
-
</dependency> -->
-
-
<!-- 本地运行环境,发布tomcat可以不需要
-
<dependency>
-
<groupId>org.apache.cxf</groupId>
-
<artifactId>cxf-rt-transports-http-jetty</artifactId>
-
<version>${cxf.version}</version>
-
</dependency>
-
-
基本上不用这个东东,太大了
-
org.apache.cxf
apache-cxf
${cxf.version}
pom
-->
配置web.xml
-
contextConfigLocation
...
/WEB-INF/cxf-beans.xml
-
-
<servlet>
-
<servlet-name>CXFServlet</servlet-name>
-
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
-
<load-on-startup>1</load-on-startup>
-
</servlet>
-
<servlet-mapping>
-
<servlet-name>CXFServlet</servlet-name>
-
<url-pattern>/services/*</url-pattern>
-
</servlet-mapping>
cxf.xml
-
<?xml version="1.0" encoding="UTF-8"?>
-
<beans xmlns=""
-
xmlns:xsi=""
-
xmlns:context=""
-
xmlns:jaxws=""
-
xsi:schemaLocation="
-
-
-
/spring-beans.xsd
-
-
/spring-context-3.0.xsd"
-
>
-
<import resource="classpath*:META-INF/cxf/cxf.xml" />
-
<import resource="classpath*:META-INF/cxf/cxf-servlet.xml" />
-
-
<jaxws:endpoint id="XXXInterface" implementor="XXX.impl.XXXServerImpl"
-
address="/XXXServerI">
-
</jaxws:endpoint>
-
</beans>
最后访问 项目/services/XXXServerI?wsdl查看发布是否成功
阅读(2303) | 评论(0) | 转发(0) |