2011年3月30日
摘要: 上次介绍了Axis的WebService,现在我们来看看CXF是怎么完成WebService的。 Axis1 WebService 在线博文: http://www.cnblogs.com/hoojo/archive/2010/12/20/1911349.html Axis2 WebService 在线博文: http://www.cnblogs.com/hoojo/archive/2011/03/16/1985160.html百度文库:http://wenku.baidu.com/view/f7f8211e59eef8c75fbfb398.html索引一、CXF WebService准备工作 阅读全文
posted @ 2011-03-30 11:52 hoojo 阅读(8399) 评论(1) 推荐(1) 编辑
摘要: 前面介绍的都是传递简单的字符串,现在开始介绍传递复杂类型的对象。如JavaBean、Array、List、Map等。 1、 首先看看服务器端的代码所需要的JavaBean对象 package com.hoo.entity;import java.io.Serializable;/** * <b>function:</b>User Entity * @author hoojo * @createDa... 阅读全文
posted @ 2011-03-30 10:51 hoojo 阅读(33359) 评论(8) 推荐(1) 编辑
摘要: 首先,CXF和spring整合需要准备如下jar包文件: 这边我是用Spring的jar包是Spring官方提供的,并没有使用CXF中的Spring的jar文件。 添加这么多文件后,首先在web.xml中添加如下配置: <!-- 加载Spring容器配置 --><listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener><!-- 设置Spring容器加载配置文件路径 --&g 阅读全文
posted @ 2011-03-30 10:50 hoojo 阅读(161394) 评论(34) 推荐(17) 编辑
摘要: 前面在Axis中介绍过Axis的Handler,这里CXF的Interceptor就和Handler的功能类似。在每个请求响应之前或响应之后,做一些事情。这里的Interceptor就和Filter、Struts的Interceptor很类似,提供它的主要作用就是为了很好的降低代码的耦合性,提供代码的内聚性。下面我们就看看CXF的Interceptor是怎么样工作的。 1、 我们就用上面的HelloWorldService,客户端的调用代码重新写一份,代码如下: package com.hoo.client;import org.apache.cxf.interceptor.LoggingIn 阅读全文
posted @ 2011-03-30 10:12 hoojo 阅读(35471) 评论(1) 推荐(3) 编辑