- 浏览: 7250241 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1546)
- 企业中间件 (236)
- 企业应用面临的问题 (236)
- 小布Oracle学习笔记汇总 (36)
- Spring 开发应用 (54)
- IBatis开发应用 (16)
- Oracle基础学习 (23)
- struts2.0 (41)
- JVM&ClassLoader&GC (16)
- JQuery的开发应用 (17)
- WebService的开发应用 (21)
- Java&Socket (44)
- 开源组件的应用 (254)
- 常用Javascript的开发应用 (28)
- J2EE开发技术指南 (163)
- EJB3开发应用 (11)
- GIS&Mobile&MAP (36)
- SWT-GEF-RCP (52)
- 算法&数据结构 (6)
- Apache开源组件研究 (62)
- Hibernate 学习应用 (57)
- java并发编程 (59)
- MySQL&Mongodb&MS/SQL (15)
- Oracle数据库实验室 (55)
- 搜索引擎的开发应用 (34)
- 软件工程师笔试经典 (14)
- 其他杂项 (10)
- AndroidPn& MQTT&C2DM&推技术 (29)
- ActiveMQ学习和研究 (38)
- Google技术应用开发和API分析 (11)
- flex的学习总结 (59)
- 项目中一点总结 (20)
- java疑惑 java面向对象编程 (28)
- Android 开发学习 (133)
- linux和UNIX的总结 (37)
- Titanium学习总结 (20)
- JQueryMobile学习总结 (34)
- Phonegap学习总结 (32)
- HTML5学习总结 (41)
- JeeCMS研究和理解分析 (9)
最新评论
-
lgh1992314:
[u][i][b][flash=200,200][url][i ...
看看mybatis 源代码 -
尼古拉斯.fwp:
图片根本就不出来好吧。。。。。。
Android文件图片上传的详细讲解(一)HTTP multipart/form-data 上传报文格式实现手机端上传 -
ln94223:
第一个应该用排它网关吧 怎么是并行网关, 并行网关是所有exe ...
工作流Activiti的学习总结(八)Activiti自动执行的应用 -
ZY199266:
获取不到任何消息信息,请问这是什么原因呢?
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息 -
xiaoyao霄:
DestinationSourceMonitor 报错 应该导 ...
ActiveMQ 通过JMX监控Connection,Queue,Topic的信息
Axis2优劣:
现在用axis2开发一个webservice工程,虽说是webservice的一个新框架,但我并没有发现他有多么的好用,反而遇到了很多麻烦的问题:
1、axis2不支持事务。
对数据库增删改查一般都需要事务处理的,但是在对外发布的接口中是不能配置事务的。
解决方法:或者写一个代理类或者直接在dao中进行事务管理。
2、axis2不支持方法重载。
在对外发布的接口中不能使用方法重载,
[WARN] We don't support method overloading. Ignoring [updateClassifyTask]
[WARN] We don't support method overloading. Ignoring [updateClassifyTask]
[WARN] We don't support method overloading. Ignoring [updateClassifyTask]
如果你写了多个重名的方法,在该service中只会注册一个。
解决方法:无。要么更改成不同的方法名要么在传参上想办法
3、AXIS2 1.4.1 does not support java.util.Date type
Time portion of java.util.Date is missing from SOAP response in Axis2 1.5
瞧瞧axis2 的这些个bug,使用起来太不方便了。
虽然Apache的官方网站的bug页上有解决方案,但是我把DateServuce。aar文件考下来后仍然报相同的错误:
[ERROR] date string can not be less than 19 charactors
Caused by: java.lang.NumberFormatException: date string can not be less than 19 charactors
也不知道是怎么个意思,是把日期转换一下吗?好郁闷- - !
Axis2 1.5只能返回日期部分,时间部分丢失了!
解决方法:把Date类型都改成String类型的,这样是最安全的,但可能跟要求不符,应该不能算是一个好的解决方案吧。
4、axis2不能传递list类型的数据集合。
解决方法:将list转换成数组类型。这个还不算麻烦吧。
package com.etrip.axis2; import java.io.Serializable; /** * * @Title: TODO * @Description: 实现TODO * @Copyright:Copyright (c) 2011 * @Company: * @Date:2012-12-29 * @author * @version 1.0 */ public class User implements Serializable { private static final long serialVersionUID = 1L; private int id; private String name; private String address; private String email; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }
package com.etrip.axis2; import java.util.ArrayList; import java.util.List; import org.springframework.stereotype.Service; /** * * @Title: TODO * @Description: 实现TODO * @Copyright:Copyright (c) 2011 * @Company * @Date:2012-12-24 * @author * @version 1.0 */ @Service public class UserService { /** * 传递数组 * @return */ public String[][] getTwoArray() { return new String[][] { { "中国", "北京" }, { "日本", "东京" }}; } /** * 传递非字符串 * @param b * @param len * @return */ public String upload4Byte(byte[] b, int len) { return String.valueOf(b)+len; } /** * 传递字符串 * @param userName * @return */ public String hello(String userName){ return "Hello ,"+userName; } /** * 传输对象 * @return */ public User getUer() { User user = new User(); user.setAddress("JingsanRoad"); user.setEmail("uer@123.com"); user.setName("spark"); user.setId(2); return user; } }
spring-app-context.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:flex="http://www.springframework.org/schema/flex" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/flex http://www.springframework.org/schema/flex/spring-flex-1.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <context:component-scan base-package="*" /> <context:annotation-config/> <bean id="applicationContext" class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder" /> </beans>
WebContent/WEB-INF/services/axis/META-INF/services.xml
<?xml version="1.0" encoding="UTF-8"?> <service name="userService"> <parameter name="ServiceObjectSupplier"> org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier </parameter> <parameter name="load-on-startup">true</parameter> <parameter name="SpringBeanName">userService</parameter> <messageReceivers> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" /> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" /> </messageReceivers> </service>
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_2_5.xsd" id="WebApp_ID" version="2.5"> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/spring-*.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <display-name>Axis2SpringWS</display-name> <servlet> <servlet-name>AxisServlet</servlet-name> <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>AxisServlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <display-name>Axis Admin Servlet</display-name> <servlet-name>AdminServlet</servlet-name> <servlet-class>org.apache.axis.transport.http.AdminServlet</servlet-class> <load-on-startup>100</load-on-startup> </servlet> <servlet-mapping> <servlet-name>AdminServlet</servlet-name> <url-pattern>/servlet/AdminServlet</url-pattern> </servlet-mapping> </web-app>
weblogic.xml
<?xml version="1.0" encoding="UTF-8"?> <wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.3/weblogic-web-app.xsd"> <wls:weblogic-version>10.3.6</wls:weblogic-version> <wls:context-root>Axis2SpringWS</wls:context-root> <wls:container-descriptor> <wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes> </wls:container-descriptor> </wls:weblogic-web-app>
详细参考:
Apache Axis2 User's Guide
http://axis.apache.org/axis2/java/core/docs/userguide.html
Axis2 Integration with the Spring Framework
http://axis.apache.org/axis2/java/core/docs/spring.html
POJO Web Services using Apache Axis2
http://axis.apache.org/axis2/java/core/docs/pojoguide.html
JAX-WS Guide
http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html
评论
[flash=200,200][url][img][list] |
[*]
|
[/list][/img][/url][/flash] |
发表评论
-
【转】在项目中使用多个数据源-多sessionFactory方案
2013-05-10 16:30 3067适用范围:适合SSH架构访问多个数据库, ... -
【转】使用spring的动态路由实现数据库负载均衡
2013-03-17 22:57 3250使用spring的动态路由实现数据库负载均衡 系统中 ... -
【转】spring 数据库读写分离
2013-03-17 22:56 2751什么是数据库的读写分离 数据库的读写分离简单的说是把对数据 ... -
[转]Spring+iBatis+JOTM实现JTA事务
2013-03-17 22:51 2989Spring+iBatis+JOTM实现JTA事务 ... -
【转】JAVA并发容器代码随读
2012-12-06 15:29 2902转载自 http://rdc.taobao.c ... -
【转】互联网常见Open API文档资源
2012-07-17 17:22 2364原文出处:http://www.williamlong.i ... -
互联网 免费的WebService接口
2012-07-08 17:25 5602股票行情数据 WEB 服务 ... -
Eclipse 根据ASP.NET WSDL自动生成Axis的WS客户端
2012-06-07 12:52 2801最近研究一下相 ... -
Spring3.04和Junit4
2011-11-27 18:15 4320在Spring3.x以上必须采用 ... -
Apache CXF REST WebService简单应用
2011-11-27 17:30 5576<p> 本文目的就项目中的Apache ... -
REST WebService简单应用(测试)
2011-11-27 16:11 4728在项目中许多同事采用Ajax调用REST Web服 ... -
REST WebService简单应用
2011-11-27 15:07 3592最近项目中WebService采用REST风格的WebS ... -
Spring加载属性文件的扩展
2011-08-22 12:21 2982在项目中一个属性文件配置信息,提供给数据连接信息 ... -
Brap的创建WebService
2011-07-26 10:33 1202通过Brap开发WebService,通过Brap的W ... -
Brap和Spring整合(简单权限验证)
2011-07-26 10:31 1341在使用Spring的发 ... -
Quartz的任务的临时启动和暂停和恢复
2011-07-16 10:18 39997在项目中需要手动启停某些服务,那么需要有一个控 ... -
Quartz中定时调度EJB3.0服务
2011-07-13 22:25 2886在quartz2.0中只支持EJb2.0的服务 ... -
Quartz中定时调度EJB2.0服务
2011-07-13 22:12 2138在Quartz2.0中提供支持EJB2.0 ... -
Quartz的简单使用
2011-07-13 22:05 9886最近工作需要学习quartz,那么必须首先了解三个概念:调度器 ... -
Brap 远程访问调用 和Spring整合(二)
2010-12-08 14:52 1966Brap和 Spring 整合使用如 ...
相关推荐
spring与axis的整合
spring和axis2 整合的小例子, WebContent\axis2-web\listServices.jsp 显示 所有 的 接口
spring3.2.5与axis2 1.6.2整合
Spring整合axis2经典
简单例子:axis2整合spring发布webservice,以及session的管理
Spring集成AXIS2的Web_service配置方法
spring+axis2整合,项目下载之后就能使用,里面简单的编写的发布服务的代码,适合初学者使用
spring4和hibernate4.2和axis2整合
NULL 博文链接:https://popomonkey.iteye.com/blog/680365
axis2+spring2.5整合(webservice)
spring集成axis发布webservice源码 spring集成axis发布webservice源码 spring集成axis发布webservice源码 spring集成axis发布webservice源码
打着灯笼都难找的资源哦,是自己辛苦整理出来的,很有用哦。
springboot集成axis2-1.7.9部署和调用实例
Axis2WebService与Spring的整合
Web services是建立可互操作的分布式应用程序的新平台。Web service平台是一套标准,它定义了应用程序如何在Web上实现互操作性。你可以用任何你喜欢的语言,在任何...在这里主要介绍两种实现方式:axis2和xfire框架。
axis2-spring-1.5.4.jar是axis2与spring整合时所需要的jar包
Axis2与Spring整合发布多个WebService,项目使用Maven管理。
NULL 博文链接:https://shihuan830619.iteye.com/blog/1621542
cxf-2.4.1+axis-1.4,整合spring3.0所用jar包
axis2+spring+ibatis整合的一个项目,含webservice文件传输