- 浏览: 334669 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
zqb666kkk:
有示例代码吗
WebService CXF学习(高级篇3):WS-Security -
zhujiangtaobl0505:
楼主有源码没?发下,我邮箱465971531@qq.com,我 ...
WebService CXF学习(高级篇2):CXF+Spring+Hibernate -
ssy341:
http://localhost:8080/jforum/in ...
JForum安装详解 -
songzht:
看了上面的代码,这两个类型是怎么定义的?private Bas ...
JfreeChar结合struts2展示柱状图和饼状图(已解决乱码问题) -
Getwaysun:
持久化类中使用boolean定义某个字段后,报Null val ...
null不能赋值给int类型,Integer可以。
前一节仅仅只讲了与Spring整合,没有涉及到数据库,而且是直接将Java象传递到服务端。这一节我起到一个回顾前面章节的作用。用在客户端运用JABX将JAVA对象编组成XML文件,在客户端将XML解组成JAVA并存入数据库。下面我们就着手开发这个Demo:
服务端开发
第一步,编写数据资源层相关接口
DAO编写:
Java代码
DAO实现类:
Java代码
实体对象:
Java代码
第二步:业务逻辑层接口编写
业务逻辑接口:
Java代码
接口实现类:
Java代码
DAO与Service接口配置:
Java代码
WebService接口发布:
Java代码
第三步:服务端程序编写了,打包部署
客户端开发
第一步:WebService客户端生成,可以手工编写。这里我就通过配置Ant文件来生成WebService客户端:
Java代码
第二步:WebService接口注册配置
Java代码
剩下的事就测试我们整合是否成功了,编写一个JUnit测试类或写一个Main函数测试一下。
Java代码
服务端开发
第一步,编写数据资源层相关接口
DAO编写:
Java代码
public interface HibernateDao { public void save(UserInfo object); public void delete(UserInfo object); public void update(UserInfo object); public UserInfo get(int id); } public interface HibernateDao { public void save(UserInfo object); public void delete(UserInfo object); public void update(UserInfo object); public UserInfo get(int id); }
DAO实现类:
Java代码
public class HibernateDaoImpl extends HibernateDaoSupport implements HibernateDao { public void delete(UserInfo object) { this.getHibernateTemplate().delete(object); } public void save(UserInfo object) { this.getHibernateTemplate().save(object); } public void update(UserInfo object) { this.getHibernateTemplate().update(object); } public UserInfo get(int id) { return (UserInfo) this.getHibernateTemplate().get(UserInfo.class, id); } } public class HibernateDaoImpl extends HibernateDaoSupport implements HibernateDao { public void delete(UserInfo object) { this.getHibernateTemplate().delete(object); } public void save(UserInfo object) { this.getHibernateTemplate().save(object); } public void update(UserInfo object) { this.getHibernateTemplate().update(object); } public UserInfo get(int id) { return (UserInfo) this.getHibernateTemplate().get(UserInfo.class, id); } }
实体对象:
Java代码
@Entity @Table(name = "userinfo") public class UserInfo implements java.io.Serializable { private static final long serialVersionUID = 2281022190032353574L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String name; private Integer age; private Integer address; public UserInfo() { } public UserInfo(String name, Integer age) { this.name = name; this.age = age; } public UserInfo(String name, Integer age, Integer address) { this.name = name; this.age = age; this.address = address; } public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public Integer getAge() { return this.age; } public void setAge(Integer age) { this.age = age; } public Integer getAddress() { return this.address; } public void setAddress(Integer address) { this.address = address; } } @Entity @Table(name = "userinfo") public class UserInfo implements java.io.Serializable { private static final long serialVersionUID = 2281022190032353574L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; private String name; private Integer age; private Integer address; public UserInfo() { } public UserInfo(String name, Integer age) { this.name = name; this.age = age; } public UserInfo(String name, Integer age, Integer address) { this.name = name; this.age = age; this.address = address; } public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public Integer getAge() { return this.age; } public void setAge(Integer age) { this.age = age; } public Integer getAddress() { return this.address; } public void setAddress(Integer address) { this.address = address; } }
第二步:业务逻辑层接口编写
业务逻辑接口:
Java代码
@WebService public interface IService { //public void save(@WebParam(name="info")String xml); public void save(@WebParam(name="dto")UserInfoDTO dto,@WebParam(name="flag")boolean flag); public void update(@WebParam(name="info")String xml); public void delete(@WebParam(name="id")int id); public @WebResult(name="String")String get(@WebParam(name="id")int id); } @WebService public interface IService { //public void save(@WebParam(name="info")String xml); public void save(@WebParam(name="dto")UserInfoDTO dto,@WebParam(name="flag")boolean flag); public void update(@WebParam(name="info")String xml); public void delete(@WebParam(name="id")int id); public @WebResult(name="String")String get(@WebParam(name="id")int id); }
接口实现类:
Java代码
@WebService public class ServiceImpl implements IService { private Logger log = LoggerFactory.getLogger(ServiceImpl.class); private HibernateDao dao; // public void setDao(HibernateDao dao) { // this.dao = dao; // } public void delete(int id) { log.info("delete id is {} user"+id); //UserInfo userInfo = (UserInfo)object; //log.info("this username is:"+userInfo.getName()); //log.info("delete {} information..."+userInfo.getName()); //dao.delete(userInfo); } // public void save(String xml) { // //UserInfo userInfo = (UserInfo)object; // log.info("add {} user..."+xml); // //dao.save(userInfo); // System.out.println("ssss"); // } public void save(UserInfoDTO dto,boolean flag) { System.out.println("name:"+dto.getName()); } public void update(String xml){ ApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext-resources.xml"); this.dao = (HibernateDao)context.getBean("dao"); try { JAXBContext jaxbContext = JAXBContext.newInstance("com.itdcl.model"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(xml); Customers cus = (Customers)unmarshaller.unmarshal(reader); Customer cust = cus.getCustomer(); UserInfo userInfo = new UserInfo(); System.out.println("Address:"+cust.getAddress()); userInfo.setAddress(cust.getAddress()); System.out.println("Age:"+cust.getAge()); userInfo.setAge(Integer.valueOf(cust.getAge())); System.out.println("Name:"+cust.getName()); //userInfo.setId(2); userInfo.setName(cust.getName()); dao.save(userInfo); } catch (JAXBException e) { e.printStackTrace(); } } public String get(int id){ //return dao.get(id); return null; } } @WebService public class ServiceImpl implements IService { private Logger log = LoggerFactory.getLogger(ServiceImpl.class); private HibernateDao dao; // public void setDao(HibernateDao dao) { // this.dao = dao; // } public void delete(int id) { log.info("delete id is {} user"+id); //UserInfo userInfo = (UserInfo)object; //log.info("this username is:"+userInfo.getName()); //log.info("delete {} information..."+userInfo.getName()); //dao.delete(userInfo); } // public void save(String xml) { // //UserInfo userInfo = (UserInfo)object; // log.info("add {} user..."+xml); // //dao.save(userInfo); // System.out.println("ssss"); // } public void save(UserInfoDTO dto,boolean flag) { System.out.println("name:"+dto.getName()); } public void update(String xml){ ApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext-resources.xml"); this.dao = (HibernateDao)context.getBean("dao"); try { JAXBContext jaxbContext = JAXBContext.newInstance("com.itdcl.model"); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); StringReader reader = new StringReader(xml); Customers cus = (Customers)unmarshaller.unmarshal(reader); Customer cust = cus.getCustomer(); UserInfo userInfo = new UserInfo(); System.out.println("Address:"+cust.getAddress()); userInfo.setAddress(cust.getAddress()); System.out.println("Age:"+cust.getAge()); userInfo.setAge(Integer.valueOf(cust.getAge())); System.out.println("Name:"+cust.getName()); //userInfo.setId(2); userInfo.setName(cust.getName()); dao.save(userInfo); } catch (JAXBException e) { e.printStackTrace(); } } public String get(int id){ //return dao.get(id); return null; } }
DAO与Service接口配置:
Java代码
<?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:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <!--*******************Hibernate数据库持久层配置文件***********************--> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:jdbc.properties</value> </list> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> ${hibernate.dialect} </prop> <prop key="hibernate.show_sql">${show_sql}</prop> <prop key="hibernate.format_sql">${format_sql}</prop> <!-- 缓存设置 --> <prop key="cache.use_query_cache"> ${cache.use_query_cache} </prop> <prop key="cache.use_second_level_cache"> ${cache.use_second_level_cache} </prop> <prop key="cache.provider_class"> ${cache.provider_class} </prop> <!-- C3P0连接池配置 --> <prop key="c3p0.acquire_increment"> ${c3p0.acquire_increment} </prop> <prop key="c3p0.max_statements"> ${c3p0.max_statements} </prop> <prop key="c3p0.min_size">${c3p0.min_size}</prop> <prop key="c3p0.max_size">${c3p0.max_size}</prop> <prop key="c3p0.timeout">${c3p0.timeout}</prop> <prop key="c3p0.idle_test_period"> ${c3p0.idle_test_period} </prop> </props> </property> <property name="namingStrategy"> <bean class="org.hibernate.cfg.ImprovedNamingStrategy" /> </property> <property name="packagesToScan" value="com.itdcl.pojo" /> </bean> <bean id="dao" class="com.itdcl.dao.HibernateDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> </beans> <?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:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation=" http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> <!--*******************Hibernate数据库持久层配置文件***********************--> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:jdbc.properties</value> </list> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> ${hibernate.dialect} </prop> <prop key="hibernate.show_sql">${show_sql}</prop> <prop key="hibernate.format_sql">${format_sql}</prop> <!-- 缓存设置 --> <prop key="cache.use_query_cache"> ${cache.use_query_cache} </prop> <prop key="cache.use_second_level_cache"> ${cache.use_second_level_cache} </prop> <prop key="cache.provider_class"> ${cache.provider_class} </prop> <!-- C3P0连接池配置 --> <prop key="c3p0.acquire_increment"> ${c3p0.acquire_increment} </prop> <prop key="c3p0.max_statements"> ${c3p0.max_statements} </prop> <prop key="c3p0.min_size">${c3p0.min_size}</prop> <prop key="c3p0.max_size">${c3p0.max_size}</prop> <prop key="c3p0.timeout">${c3p0.timeout}</prop> <prop key="c3p0.idle_test_period"> ${c3p0.idle_test_period} </prop> </props> </property> <property name="namingStrategy"> <bean class="org.hibernate.cfg.ImprovedNamingStrategy" /> </property> <property name="packagesToScan" value="com.itdcl.pojo" /> </bean> <bean id="dao" class="com.itdcl.dao.HibernateDaoImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> </beans>
WebService接口发布:
Java代码
<?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-2.0.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="serverUserInfo" class="com.itdcl.model.UserInfoDTO" /> <jaxws:endpoint id="helloWorld" implementor="com.itdcl.service.HelloWorldImpl" address="/HelloWorld" /> <jaxws:endpoint id="myTest" implementor="com.itdcl.service.MyTestImpl" address="/MyTest" /> <jaxws:endpoint id="service" implementor="com.itdcl.service.ServiceImpl" address="/Service"> <!-- jaxws:serviceFactory> <ref bean="jaxWsServiceFactoryBean" /> </jaxws:serviceFactory>--> </jaxws:endpoint> <bean id="jaxWsServiceFactoryBean" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> <property name="wrapped" value="true" /> <property name="dataBinding" ref="aegisBean" /> </bean> <bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" /> </beans> <?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-2.0.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="serverUserInfo" class="com.itdcl.model.UserInfoDTO" /> <jaxws:endpoint id="helloWorld" implementor="com.itdcl.service.HelloWorldImpl" address="/HelloWorld" /> <jaxws:endpoint id="myTest" implementor="com.itdcl.service.MyTestImpl" address="/MyTest" /> <jaxws:endpoint id="service" implementor="com.itdcl.service.ServiceImpl" address="/Service"> <!-- jaxws:serviceFactory> <ref bean="jaxWsServiceFactoryBean" /> </jaxws:serviceFactory>--> </jaxws:endpoint> <bean id="jaxWsServiceFactoryBean" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"> <property name="wrapped" value="true" /> <property name="dataBinding" ref="aegisBean" /> </bean> <bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" /> </beans>
第三步:服务端程序编写了,打包部署
客户端开发
第一步:WebService客户端生成,可以手工编写。这里我就通过配置Ant文件来生成WebService客户端:
Java代码
<?xml version="1.0"?> <project name="cxf" basedir="." default="usage"> <property name="webroot.dir" value="E:/workspace3/CXFSpring" /> <!-- webservice接口 --> <property name="target.class" value="com.itdcl.service.IService" /> <property name="wsdl.name" value="Service.wsdl" /> <property name="src.dir" value="src" /> <property name="client.dir" value="client" /> <property name="server.dir" value="server" /> <property name="compile.dir" value="${webroot.dir}/bin" /> <target name="usage"> <echo message="java2wsdl -->java文件生成wsdl文件,java2wsdl -Ddir=com/starit/cxf/java2wsdl -Dsrc=com.starit.cxf.java2wsdl.Hello" /> <echo message="wsdl2javaClient -->java文件生成client,java2wsdl -Ddir=com/starit/cxf/java2wsdl -Dwsdl=hello.wsdl" /> </target> <target name="java2wsdl"> <echo message="生成wsdl文件" /> <exec dir="${compile.dir}" executable="cmd.exe"> <arg line="/c java2ws" /> <arg line="-o ${wsdl.name} -wsdl ${target.class}" /> </exec> <!-- copy资源文件 --> <move todir="${src.dir}" preservelastmodified="true"> <fileset dir="${compile.dir}"> <include name="**/*.wsdl" /> </fileset> </move> </target> <target name="wsdl2javaClient"> <echo message="生成java client文件" /> <mkdir dir="${client.dir}" /> <exec dir="." executable="cmd.exe"> <arg line="/c wsdl2java" /> <!-- 生成的java所存目录 --> <arg line="-d ${client.dir}"/> <!-- wsdl文件所在路径 --> <arg line="-client src\*.wsdl" /> </exec> </target> </project> <?xml version="1.0"?> <project name="cxf" basedir="." default="usage"> <property name="webroot.dir" value="E:/workspace3/CXFSpring" /> <!-- webservice接口 --> <property name="target.class" value="com.itdcl.service.IService" /> <property name="wsdl.name" value="Service.wsdl" /> <property name="src.dir" value="src" /> <property name="client.dir" value="client" /> <property name="server.dir" value="server" /> <property name="compile.dir" value="${webroot.dir}/bin" /> <target name="usage"> <echo message="java2wsdl -->java文件生成wsdl文件,java2wsdl -Ddir=com/starit/cxf/java2wsdl -Dsrc=com.starit.cxf.java2wsdl.Hello" /> <echo message="wsdl2javaClient -->java文件生成client,java2wsdl -Ddir=com/starit/cxf/java2wsdl -Dwsdl=hello.wsdl" /> </target> <target name="java2wsdl"> <echo message="生成wsdl文件" /> <exec dir="${compile.dir}" executable="cmd.exe"> <arg line="/c java2ws" /> <arg line="-o ${wsdl.name} -wsdl ${target.class}" /> </exec> <!-- copy资源文件 --> <move todir="${src.dir}" preservelastmodified="true"> <fileset dir="${compile.dir}"> <include name="**/*.wsdl" /> </fileset> </move> </target> <target name="wsdl2javaClient"> <echo message="生成java client文件" /> <mkdir dir="${client.dir}" /> <exec dir="." executable="cmd.exe"> <arg line="/c wsdl2java" /> <!-- 生成的java所存目录 --> <arg line="-d ${client.dir}"/> <!-- wsdl文件所在路径 --> <arg line="-client src\*.wsdl" /> </exec> </target> </project>
第二步:WebService接口注册配置
Java代码
<?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-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <!-- jaxws:client id="helloWorldClient" address="http://localhost:9999/cxf/HelloWorld" serviceClass="com.itdcl.service.IHelloWorld" />--> <!-- jaxws:client id="myTestClient" address="http://localhost:9999/cxf/MyTest" serviceClass="com.itdcl.service.IMyTest" />--> <jaxws:client id="service" address="http://localhost:9999/cxf/Service" serviceClass="com.itdcl.service.IService" /> </beans> <?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-2.0.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <!-- jaxws:client id="helloWorldClient" address="http://localhost:9999/cxf/HelloWorld" serviceClass="com.itdcl.service.IHelloWorld" />--> <!-- jaxws:client id="myTestClient" address="http://localhost:9999/cxf/MyTest" serviceClass="com.itdcl.service.IMyTest" />--> <jaxws:client id="service" address="http://localhost:9999/cxf/Service" serviceClass="com.itdcl.service.IService" /> </beans>
剩下的事就测试我们整合是否成功了,编写一个JUnit测试类或写一个Main函数测试一下。
Java代码
public class JaxbSampleClient { private final static String MODEL = "com.itdcl.model"; public static void main(String[] args) throws FileNotFoundException, JAXBException, ParserConfigurationException, TransformerException { ApplicationContext context = new ClassPathXmlApplicationContext( "beans.xml"); IService service = (IService) context.getBean("service"); ObjectFactory factory = new ObjectFactory(); Customer customer = factory.createCustomer(); customer.setId(1); customer.setAge("26"); customer.setName("Josen"); customer.setAddress(100); Customers customers = factory.createCustomers(); customers.setCustomer(customer); DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.newDocument(); // 转换 JAXBContext jaxbContext = JAXBContext.newInstance(MODEL); Marshaller marshaller = jaxbContext.createMarshaller(); //将customers数据与doc绑定 marshaller.marshal(customers, doc); DOMSource domSource = new DOMSource(doc); StringWriter writer = new StringWriter(); StreamResult result = new StreamResult(writer); TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.transform(domSource, result); String xmlString = writer.toString(); //System.out.println(xmlString); service.update(xmlString); } }
发表评论
-
WebService CXF学习(高级篇3):WS-Security
2011-03-21 10:15 2232这一节我们来探讨一下WebService安全问题,如果所有系统 ... -
WebService CXF学习(进阶篇4):JAXB剖析
2011-03-21 10:08 2073前面几节我们讲解对象传递,但是通常情况下我们不直接传对象,因为 ... -
WebService CXF学习(高级篇1):整合Spring框架
2011-03-21 10:05 1999通过前面两节的讲解,相信你对CXF框架开始有一些认识了。在当今 ... -
WebService CXF学习(进阶篇3):对象传递
2011-03-21 10:03 1890前面几节都是讲一些理论知识,现在又用一个例子来说明一下,这一节 ... -
WebService CXF学习(进阶篇2):JAX-WS讲解
2011-03-21 10:00 1362JAX-WS规范是一组XML web services的 ... -
WebService CXF学习(进阶篇1):SOAP讲解
2011-03-21 09:49 1550SOAP 是基于 XML 的简易协 ... -
WebService CXF学习(入门篇3):WSDL描述
2011-03-21 09:42 1795由于网上有很多相关这 ... -
WebService CXF学习(入门篇2):HelloWorld
2011-03-21 09:37 2020理论联系实际,单单只讲理论那就成了纸上谈兵,用一个HelloW ... -
WebService CXF学习(入门篇1):CXF由来
2011-03-21 09:35 1812WebService介绍 WebServi ...
相关推荐
CXF+Spring+Hibernate实现WebService,实现的方法比较简单,只有一个增加的方法,没有用到Struts 有服务端代码和客户端测试代码
做开发时,查了大量资料,发现一比较全面的资料,分享一下!...WebService CXF学习——高级篇(一)(二) 1.整合Spring框架 2.CXF+Spring+Hibernate 3.WS-Security WebService CXF学习——JAXB剖析
整合了Spring Hibernate CXF 对于WebService的开发,使用的DB是Mysql,主要就是做了一个Demo
springMVC+hibernate+webservice
cxf+spring+hibernate集成整合jar包
完整的cxf+hibernate+spring实现 weblogic 和tomcat上完美兼容
这是个采用apache cxf实现webservice的示例,主要由spring整合hibernate、struts2实现webservice,里面struts2用到得较少……对于学习很有帮助,另外我觉得若是初学者,不过采用那方式,现在按照套方案做熟练后再去...
是eclipse导出的war文件,包含了资源。开发环境jdk1.7 tomcat7。 通过了测试,对应的文档:http://blog.csdn.net/biboheart/article/details/9148651, 有文档了,这里就不多说了。
cxf spring Hibernate 搭建webservice,在myEclipse中成功运行。数据库为mysql,sql文件在项目里。所需jar包在图片中,根据图片自己添加相应jar包。
使用spring集成cxf,在两个web ...server端使用spring+springmvc+mybatis+cxf,client端使用struts2+spring+hibernate+cxf 两个工程均为myeclipse project,包含所有除myeclipse自带以外所有jar 内附 使用文档,数据库脚本
本项目结合springMVC(4.0.3.RELEASE) + spring + hibernate(4.3.5.Final) + CXF(2.6.8)+ mysql + jquery等技术,并以Maven形式实现。具体包含以下主要功能点: 1.用CXF实现Webservice和Restful服务 2.分别使用...
使用spring+cxf发布webservice,集成了hibernate
网上资料大多是只有spring+xfire 含有Hibernate的少 3.配置时候还遇到spring实现 客户端调用服务器端时候 注入失败 4.在服务器端向客户端做映射的时候失败 5.在服务器端获取非基本类转化问题
CXF环境配置 - jackymin CXF与Spring的集成 log4j的配置使用 Spring XML配置十二个最佳实践WebService开发实例 (Xfire+Spring+Hibernate)
本源码提供了一个基于Spring MVC、CXF和Hibernate的Web服务与数据库操作设计。项目包含53个文件,其中包括15个XML文件、13个Java源文件、10个属性文件、3个YAML文件、3个JSP页面、2个MF文件、1个Gitignore文件、1个...
使用spring和cxf发布webservice,并将springmvc和hibernate集成了,用的是c3p0数据源和2级缓存
CXF Webservice 整合Spring+Hibernate,实现Webservice开发
完整代码,包括jar包,下载即可运行!有什么不妥的,欢迎大家评论批评!
3、该项目采用了struts2 hibernate spring和 spring data jpa 开源框架完成,并融入了cxf开源webservice框架的应用,而这些技术都是当下流行的技术。 4、在缓存方面运用了互联网的流行技术redis实现缓存存贮,...
浪曦航母战斗编队式企业级项目培训系列明细 JAVA,JSP/Servlet基础 Struts2 ...Mule Esb发布基于CXF,Axis的WebService, Extjs3.2与Html/css/js整合打造不规则九宫格效果 JBPM4.4开发销售工作流