apache cxf ws spring
来源:互联网 发布:app软件培训多少钱 编辑:程序博客网 时间:2024/06/11 19:30
前面的两个环节都是纯java发布webservice,接下来我们整合spring利用tomcat来发布我们的webservice
1、web.xml文件配置cxf和spring的监听器
<?xml version="1.0" encoding="UTF-8"?><web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><display-name>CXF Servlet</display-name><context-param><param-name>contextConfigLocation</param-name><param-value>springFrame/applicationContext-*.xml</param-value></context-param><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><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><welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list></web-app>
2、applicationContext-ws.xml放在WebRoot下面新建springFrame文件夹下面
<?xml version="1.0" encoding="UTF-8"?><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.xsdhttp://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-servlet.xml" /> <jaxws:endpoint id="helloWorld" implementor="com.cxf.webService.impl.HelloWorldImpl" address="/HelloWorld"> </jaxws:endpoint></beans>
3、启动tomcat的之后就是查看到发布的webservice,通过浏览器访问http://localhost:8080/cxf_web/services/HelloWorld?wsdl查看是否发布成功
0 0
- apache cxf ws spring
- Apache cxf spring ws 加密
- apache cxf ws demo
- Apache CXF Tutorial – WS-Security with Spring
- Apache CXF JAX-WS example
- 让Apache CXF支持WS-Security规范
- cxf + spring 的WS-Security示例
- webservice框架(cxf, axis2, spring-ws)
- WS之cxf与spring整合1
- WS之cxf与spring整合2
- cxf + spring 的WS-Security示例
- webservice cxf+spring+WS-security配置示例
- Spring整合Apache CXF
- Spring+Apache CXF集成
- WS (CXF) JAX-WS
- Apache Axis2, CXF and Sun JAX-WS RI in comparison
- apache cxf之 一个简单的JAX-WS服务程序
- Apache CXF Spring SOAP example
- BUPTOJ 0090 字符串转换
- C++ 公有继承、保护继承、私有继承的区别
- JAVA--异常
- 从Maven仓库中导出jar包
- 书不在多,精读则灵------- Oracle入门书籍推荐
- apache cxf ws spring
- linux下汇编
- coco笔记:如何管好.net的内存
- [C#]Winform后台提交数据且获取远程接口返回的XML数据,转换成DataSet
- 移动硬盘分区后丢失数据怎么恢复
- AutoLayout详解
- Jdbc的普通封装
- x86体系结构
- 动态设置表结构方案