maven+spring3+cxf 搭建webservice服务
来源:互联网 发布:句子知乎诗词 编辑:程序博客网 时间:2024/05/23 15:19
1.web.xml
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>activiti</display-name> <!-- 设置Spring容器加载配置文件路径 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml,classpath:applicationContext-activiti.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>CXFService</servlet-name> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>CXFService</servlet-name> <url-pattern>/webservices/*</url-pattern> </servlet-mapping> </web-app>
2.
<?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:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"xmlns:cache="http://www.springframework.org/schema/cache" xmlns:p="http://www.springframework.org/schema/p"xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:cxf="http://cxf.apache.org/core"xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-3.1.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
<!-- 下面3个配置文件,是CXF自带的配置文件,引入即可这里不做详解 --> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /><jaxws:endpoint id="processServcie" implementor="com.boco.eoms.process.activiti.service.ProcessSheetService" address="/processSheetService"></jaxws:endpoint>
3.创建接口
@WebServicepublic interface ProcessService {/** * 创建流程 */public String triggerProcess(@WebParam(name = "userId") String userId, @WebParam(name = "password")String password,@WebParam(name = "processTemplateName")String processTemplateName, @WebParam(name = "operationName")String operationName, @WebParam(name = "triggerProcessData")TriggerProcessData triggerProcessData);
4.实现类
@WebService(endpointInterface="com.boco.eoms.process.activiti.service.ProcessService")public class ProcessSheetService implements ProcessService {5.pom.xml增加
<dependency><groupId>org.apache.cxf</groupId><artifactId>cxf-rt-frontend-jaxws</artifactId><version>2.7.10</version></dependency><dependency><groupId>org.apache.cxf</groupId><artifactId>cxf-rt-transports-http</artifactId><version>2.7.10</version></dependency>
6.把工程部署到tomcat,启动后,访问
http://127.0.0.1:8080/工程名/webservices/processSheetService?wsdl
如果访问成功,证明webservcie服务搭建成功
1 1
- maven+spring3+cxf 搭建webservice服务
- 使用Maven搭建CXF webservice
- Eclipse+Maven+Spring+CXF 构建webservice 服务
- Eclipse+Maven+Spring+CXF 构建webservice 服务
- 使用CXF和spring搭建webService服务
- 使用CXF框架搭建WebService服务接口
- spring3.0+cxf webservice开发
- maven+CXF编写webservice
- IDEA+maven+CXF+WebService
- 搭建web项目结合spring+cxf的webservice服务
- 搭建web项目结合spring+cxf的webservice服务
- 搭建web项目结合spring+cxf的webservice服务
- CXF实现webService服务
- cxf发布webservice 服务
- CXF创建WebService服务
- CXF3.0.1+spring+maven搭建webservice服务
- WebService:搭建cxf环境
- Maven 集成CXF Webservice,Spring
- IOS开发 GCD多线程编程技术(一)
- BOJ 27590 糖果传递
- QT 内建控件概览
- mysqldump 导出数据文件,是乱码,何解?
- android 面试知识个人积累1
- maven+spring3+cxf 搭建webservice服务
- (Java)微信之个人公众账号开发(二)——接收并处理用户消息(上)
- 使用plist创建精灵并执行动画
- WebService框架整理(一) Axis1
- Android_ViewPager_实现多个图片水平滚动
- 第四章、Spring学习-Controller接口控制器详解(6)
- Android网络切换分析
- C语言string.h头文件函数
- KMP算法