源码下载 http://download.csdn.net/download/knight_black_bob/9435077
效果图
http://localhost:8080/RepositoryPic/WebService/
http://localhost:8080/RepositoryPic/WebService/rest/picRepository/users/1/pics/1
http://localhost:8080/RepositoryPic/WebService/rest/showPic/users/1/pics/aaa.png
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.repository</groupId> <artifactId>RepositoryPic</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>RepositoryPic Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.7</java.version> <!-- <spring.version>3.2.8.RELEASE</spring.version> --> <spring.version>4.1.2.RELEASE</spring.version> <servlet.api.version>2.5</servlet.api.version> <slf4j.version>1.7.5</slf4j.version> <cxf.version>2.7.12</cxf.version> <jackson.version>2.1.4</jackson.version> <commons.version>2.2</commons.version> </properties> <dependencies> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>${commons.version}</version> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>${commons.version}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.3</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.34</version> </dependency> <!-- SPRING JDBC --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>javax.transaction</groupId> <artifactId>transaction-api</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.4</version> </dependency> <!-- spring begin --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc-portlet</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <!-- spring end --> <!-- @Inject begin --> <dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId> <version>1</version> </dependency> <!-- @Inject end --> <!-- servlet begin --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>${servlet.api.version}</version> </dependency> <!-- servlet end --> <!-- cxf begin --> <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-frontend-jaxrs</artifactId> <version>${cxf.version}</version> <exclusions> <exclusion> <groupId>asm</groupId> <artifactId>asm-parent</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-rs-extension-providers</artifactId> <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>${cxf.version}</version> </dependency> <dependency> <groupId>org.codehaus.jettison</groupId> <artifactId>jettison</artifactId> <version>1.3.2</version> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> <version>1.1.1</version> </dependency> <!-- cxf end --> <!-- JSON begin --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-jaxb-annotations</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.0</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>1.9.0</version> </dependency> <!-- JSON end --> </dependencies> <reporting> <plugins> <!-- findbugs plugin --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>3.0.3</version> <configuration> <xmlOutput>true</xmlOutput> <xmlOutputDirectory>target/site</xmlOutputDirectory> </configuration> </plugin> </plugins> </reporting> </project>
applicationContext-cxf-soap.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd" default-autowire="byName"> <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="inMessageInterceptor" class="org.apache.cxf.interceptor.LoggingInInterceptor"/> <bean id="outLoggingInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> <jaxws:endpoint implementor="cmcc.picrepository.webservice.impl.PicRepositorySoapServiceImpl" address="/picRepositorySoapService"></jaxws:endpoint> </beans>
applicationContext-cxf-rest.xml
<?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:jaxrs="http://cxf.apache.org/jaxrs" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.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" /> <jaxrs:server id="restServiceContainer" address="/rest"> <jaxrs:providers> <ref bean="jacksonProvider" /> </jaxrs:providers> <jaxrs:extensionMappings> <entry key="json" value="application/json" /> <entry key="xml" value="application/xml" /> </jaxrs:extensionMappings> <jaxrs:serviceBeans> <ref bean="picRepositoryRestService" /> <ref bean="showPicRestService" /> </jaxrs:serviceBeans> <jaxrs:inInterceptors> <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"></bean> </jaxrs:inInterceptors> <jaxrs:outInterceptors> <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"></bean> </jaxrs:outInterceptors> </jaxrs:server> <bean id="jacksonObjectMapper" class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean"></bean> <bean id="jacksonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"> <property name="mapper" ref="jacksonObjectMapper" /> </bean> </beans>
package cmcc.picrepository.restfulservice; import javax.annotation.Resource; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; import javax.ws.rs.core.Response.Status; import org.springframework.stereotype.Component; import cmcc.picrepository.dto.PicRepository; import cmcc.picrepository.dto.PicRepositorys; import cmcc.picrepository.webservice.PicRepositorySoapService; /** * @author baoyou E-mail:curiousby@163.com * @version 2016年2月16日 下午1:47:41 * * desc: ... */ @Path(value = "/picRepository") @Produces({ MediaType.APPLICATION_XML}) @Consumes({ MediaType.APPLICATION_XML}) @Component public class PicRepositoryRestService { @Resource PicRepositorySoapService picRepositorySoapService; @GET @Produces({ MediaType.APPLICATION_XML}) @Path("/users/{userId}/pics/{picRepositoryId}") public PicRepository getPicRepository(@PathParam("userId")int userId,@PathParam("picRepositoryId")int picRepositoryId) { PicRepository picRepository =picRepositorySoapService.get(picRepositoryId); if (picRepository == null) { ResponseBuilder builder = Response.status(Status.NOT_FOUND); builder.type("application/xml"); builder.entity("<errorMsg>PicRepository with id:" + picRepositoryId+ " can not be found!</errorMsg>"); throw new WebApplicationException(builder.build()); } else { System.out.println("PicRepository with id:" + picRepositoryId+ " is found"); return picRepository; } } @POST @Consumes({ MediaType.APPLICATION_XML}) @Path("/add") public Response addPicRepository(PicRepository picRepository) { picRepositorySoapService.add(picRepository); return Response.ok(picRepository).build(); } @DELETE @Consumes({ MediaType.APPLICATION_XML}) @Path("/delete/{picRepositoryId}") public Response deletePicRepository(@PathParam("picRepositoryId")int picRepositoryId) { return null; } @PUT @Path("/put") @Consumes({ MediaType.APPLICATION_XML}) public Response updatePicRepository(PicRepository picRepository) { return null; } @GET @Path("/getAlls") @Produces({ MediaType.APPLICATION_XML}) public PicRepositorys getPicRepositorys() { return null; } }
package cmcc.picrepository.restfulservice; import java.io.File; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.springframework.stereotype.Component; /** * @author baoyou E-mail:curiousby@163.com * @version 2016年2月17日 下午2:26:59 * * desc: ... */ @Path(value = "/showPic") @Produces({ MediaType.APPLICATION_XML}) @Consumes({ MediaType.APPLICATION_XML}) @Component public class ShowPicRestService { @GET @Produces("image/*") @Path("/users/{userId}/pics/{picName}") public Response getInputStream(@PathParam("userId")int userId,@PathParam("picName")String picName) { File file = new File("C:\\Users\\cmcc-B100036\\Desktop\\1.png"); return Response.ok(file,"image/jpg").build(); } }
package cmcc.picrepository.webservice; import java.util.List; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; import cmcc.picrepository.dto.PicRepository; /** * @author baoyou E-mail:curiousby@163.com * @version 2016年2月18日 上午9:51:35 * * desc: ... */ @WebService @SOAPBinding(style = Style.RPC) public interface PicRepositorySoapService { public List<PicRepository> getAlls(); public void del(Integer picRepositoryId); public PicRepository get(Integer picRepositoryId); public void update(PicRepository picRepository); public void add(PicRepository picRepository); }
package cmcc.picrepository.webservice.impl; import java.util.List; import javax.annotation.Resource; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; import org.springframework.stereotype.Service; import cmcc.picrepository.dao.PicRepositoryDao; import cmcc.picrepository.dto.PicRepository; import cmcc.picrepository.webservice.PicRepositorySoapService; /** * @author baoyou E-mail:curiousby@163.com * @version 2016年2月18日 上午9:54:43 * * desc: ... */ @Service @WebService(endpointInterface="cmcc.picrepository.webservice.PicRepositorySoapService", serviceName="PicRepositorySoapService") @SOAPBinding(style = Style.RPC) public class PicRepositorySoapServiceImpl implements PicRepositorySoapService{ @Resource PicRepositoryDao picRepositoryDao; @Override public List<PicRepository> getAlls() { return null; } @Override public void del(Integer picRepositoryId) { // TODO Auto-generated method stub } @Override public PicRepository get(Integer picRepositoryId) { return picRepositoryDao.getPicRepositoryById(picRepositoryId); } @Override public void update(PicRepository picRepository) { // TODO Auto-generated method stub } @Override public void add(PicRepository picRepository) { // TODO Auto-generated method stub } }
package cmcc.picrepository.util; import java.text.SimpleDateFormat; import java.util.Date; import javax.xml.bind.annotation.adapters.XmlAdapter; public class DateAdapter extends XmlAdapter<String, Date> { private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Override public String marshal(Date v) throws Exception { return dateFormat.format(v); } @Override public Date unmarshal(String v) throws Exception { return dateFormat.parse(v); } }
package cmcc.picrepository.dto; import java.io.Serializable; import java.util.Date; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import cmcc.picrepository.util.DateAdapter; /** * @author baoyou E-mail:curiousby@163.com * @version 2016年2月15日 上午11:25:20 * * desc: ... */ @XmlRootElement(name = "PicRepository") @XmlAccessorType(XmlAccessType.FIELD) public class PicRepository implements Serializable{ private static final long serialVersionUID = 1L; // id,origin_name,path,user_id,link,insert_time,last_update_time,desc,nextfix,pic_size private int id; private String originName; private String path; private int userId; private String link; @XmlJavaTypeAdapter(DateAdapter.class) private Date insertTime; @XmlJavaTypeAdapter(DateAdapter.class) private Date lastUpdateTime; private String description; private String nextfix; private int picSize; public int getId() { return id; } public String getOriginName() { return originName; } public String getPath() { return path; } public int getUserId() { return userId; } public String getLink() { return link; } public Date getInsertTime() { return insertTime; } public Date getLastUpdateTime() { return lastUpdateTime; } public String getDescription() { return description; } public String getNextfix() { return nextfix; } public int getPicSize() { return picSize; } public void setId(int id) { this.id = id; } public void setOriginName(String originName) { this.originName = originName; } public void setPath(String path) { this.path = path; } public void setUserId(int userId) { this.userId = userId; } public void setLink(String link) { this.link = link; } public void setInsertTime(Date insertTime) { this.insertTime = insertTime; } public void setLastUpdateTime(Date lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; } public void setDescription(String description) { this.description = description; } public void setNextfix(String nextfix) { this.nextfix = nextfix; } public void setPicSize(int picSize) { this.picSize = picSize; } }
package cmcc.picrepository.dao.impl; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Repository; import cmcc.picrepository.base.dao.JdbcTempBaseDao; import cmcc.picrepository.dao.PicRepositoryDao; import cmcc.picrepository.dto.PicRepository; /** * @author baoyou E-mail:curiousby@163.com * @version 2016年2月15日 下午2:59:54 * * desc: ... */ @Repository public class PicRepositoryDaoImpl extends JdbcTempBaseDao implements PicRepositoryDao{ @SuppressWarnings({ "rawtypes" }) private class PicRepositoryRowMapper implements RowMapper { @Override public PicRepository mapRow(ResultSet rs, int i) throws SQLException { PicRepository pr = new PicRepository(); pr.setId(rs.getInt("id")); pr.setOriginName(rs.getString("origin_name")); pr.setPath(rs.getString("path")); pr.setUserId(rs.getInt("user_id")); pr.setLink(rs.getString("link")); pr.setInsertTime(rs.getDate("insert_time")); pr.setLastUpdateTime(rs.getDate("last_update_time")); pr.setDescription(rs.getString("description")); pr.setNextfix(rs.getString("nextfix")); pr.setPicSize(rs.getInt("pic_size")); return pr; } } @SuppressWarnings("unchecked") @Override public List<PicRepository> getAlls() { String sql = "select * from picrepository"; return this.getJdbcTemplate().query(sql, new PicRepositoryRowMapper()); } @SuppressWarnings("unchecked") @Override public PicRepository getPicRepositoryById(int picRepositoryId) { String sql = "select * from picrepository where id=" + picRepositoryId; List<PicRepository> userList = this.getJdbcTemplate().query(sql, new PicRepositoryRowMapper()); if (userList !=null && userList.size() > 0 ) { return userList.get(0); }else{ return null; } } @Override public int savePicRepository(PicRepository picRepository) { String sql = "insert into picrepository(origin_name,path,user_id,link,insert_time,last_update_time,description,nextfix,pic_size) values (?,?,?,?,?,?,?,?,?)"; return this.getJdbcTemplate().update(sql, new Object[] { picRepository.getOriginName() ,picRepository.getPath() ,picRepository.getUserId() ,picRepository.getLink() ,picRepository.getInsertTime() ,picRepository.getLastUpdateTime() ,picRepository.getDescription() ,picRepository.getNextfix() ,picRepository.getPicSize() }); } }
package cmcc.picrepository.base.dao; import javax.annotation.PostConstruct; import javax.annotation.Resource; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.support.JdbcDaoSupport; /** * @author baoyou E-mail:curiousby@163.com * @version 2016年2月17日 上午11:42:53 * * desc: ... */ public class JdbcTempBaseDao extends JdbcDaoSupport { @Resource(name = "jdbcTemplate") public JdbcTemplate jdbcTemplate; @PostConstruct public void initSqlMapClient() { super.setJdbcTemplate(jdbcTemplate); } }
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!
相关推荐
在构建类似七牛的图床服务时,我们可以利用RESTful API设计原则,这是一套用于构建web服务的标准方法,强调资源的表述状态转移。RESTful API通常通过HTTP协议进行通信,支持GET、POST、PUT、DELETE等操作,使得...
在IT行业中,REST和SOAP是两种常见的Web服务接口设计风格,而CXF是一个流行的开源框架,用于构建和消费这两种服务。Maven是一个项目管理和综合工具,SpringMVC则是Spring框架的一部分,专门用于构建Web应用程序。...
**标题解析:** "CXF RESTful spring maven CRUD" 这个标题表明这是一个使用CXF框架、Spring和Maven构建的RESTful Web服务的示例项目,它实现了CRUD(创建、读取、更新、删除)操作。CXF是一个开源的服务框架,它...
在IT行业中,CXF是一个广泛使用的开源框架,用于构建和开发Web服务,包括SOAP和RESTful接口。本篇文章将深入探讨如何使用CXF、Spring、Maven等技术栈来发布一个支持HTTP请求和SOAP调用的RestFul接口。 首先,我们...
在这个“Spring CXF Restful实例”中,我们将深入探讨如何利用Spring CXF来创建RESTful API。REST(Representational State Transfer)是一种软件架构风格,常用于构建现代Web服务,强调简洁、无状态和基于标准的...
在IT行业中,Web服务是应用程序之间进行通信的一种标准方法,其中两种主要的接口类型是SOAP(Simple Object Access Protocol)和RESTful(Representational State Transfer)。本篇将详细讲解如何使用Apache CXF框架...
Apache CXF是一个开源的Java框架,主要用于构建和开发服务导向架构(SOA)的应用程序,它支持多种Web服务标准,如SOAP、RESTful、WS-*等。在本实例中,我们将探讨如何利用Maven这一强大的构建工具,有效地管理和构建...
CXF是一个开源框架,主要用于构建和部署SOAP和RESTful Web服务,Spring则是一个广泛应用的Java企业级开发框架,而Maven是项目管理和集成工具,负责构建、依赖管理和项目信息管理。本实例将展示如何利用这三者来搭建...
通过不断学习和实践,你将能够掌握更多关于RESTful API设计的最佳实践,以及如何利用Apache CXF、Spring和Maven构建更复杂、更健壮的服务。记得不断探索和研究,因为技术总是在不断发展和进步。
【Spring CXF REST Demo】项目是一个使用Maven构建的Java应用程序,它展示了如何将Spring框架与Apache CXF集成,以创建RESTful风格的服务。在这个项目中,开发者可以学习到如何利用CXF作为服务端的REST服务提供者,...
Apache CXF是一个开源的Java框架,它允许开发人员创建和消费各种Web服务,包括SOAP和RESTful类型。Spring框架则提供了依赖注入和面向切面编程的能力,方便管理和集成各种组件,而Maven则是项目构建和管理工具,负责...
Apache CXF是一个开源的SOAP和RESTful Web服务框架,支持多种协议和绑定机制。CXF允许开发者选择使用Java API for RESTful Web Services (JAX-RS)标准或者CXF自身的API来开发REST服务。JAX-RS是Java平台上的RESTful...
Apache CXF是一个开源的Java框架,它允许开发者创建和消费各种Web服务,包括SOAP和RESTful服务。Maven作为项目管理和构建工具,通过管理项目的依赖关系和提供标准化的构建过程,简化了项目的开发流程。 【描述】...
【标题】:CXF RESTful服务的实现与应用 【正文】: Apache CXF是一个流行的开源框架,用于构建和开发Web服务。它支持多种协议,包括RESTful(Representational State Transfer)风格的服务,使得开发者可以方便地...
结合网上的例子,在本地搭建并且跑通了的基于CXF的例子,soap webservice 和 restful webservice的混搭模式. 依赖cxf 3.0.4 测试工具SOAPUI 5.0 服务器 tomcat 7 浏览器 chrome
【标题】基于CXF 2.7.5开发的WebService:SOAP与RESTful详解 【描述】本项目是使用Apache CXF 2.7.5版本实现的WebService服务,包括了SOAP和RESTful两种常见的Web服务接口。Apache CXF是一个开源的Java框架,它为...
本文将详细介绍如何使用CXF和Maven来开发RESTful服务。 首先,我们需要理解REST(Representational State Transfer)的核心概念。REST是一种架构风格,它强调资源的识别和通过统一接口进行操作。在RESTful服务中,...
在【压缩包子文件的文件名称列表】中,“Charles_cxfdemo”可能是一个包含源代码、配置文件、测试用例等相关资料的文件夹,可能是以开发者的名字或者某种特定的命名规则来命名的。在这个文件夹中,我们可能会找到...
**CXF**:CXF(Camel XFire)是一个开源的SOAP和RESTful Web服务框架,它允许开发者轻松地创建和消费Web服务。CXF提供了多种协议支持,如HTTP、JMS等,并且与Spring框架深度集成,使得配置和管理Web服务变得简单。在...
【标题】"CXF-SOAP搭建WebService服务端demo"主要涵盖了使用Apache CXF框架、Spring框架、Maven构建工具以及SOAP协议来创建一个Web服务端的实例。这个过程涉及了多个关键知识点,下面将详细阐述。 【SOAP】:简单...