本站首页    管理页面    写新日志    退出

The Neurotic Fishbowl

[web Server技术]axis2安装步骤
狂飙的蜗牛 发表于 2006/6/14 10:49:38

Axis2是全新设计的,大家可以试试采用新的架构来让Axis更加的富有弹性,更有效率,并且更加的可配置。Axis2现在具有的一些feature: peedLow memory foot printAXIOM - AXis Object ModelHot DeploymentAsynchronous Web ServicesMEP Support - Message Exchange PatternsFlexibilityStabilityComponent-oriented deploymentTransport frameworkWSDL support 有些feature现在看不懂,还是先动手做一下,感性认识一下吧 第一步:下载AXIS2。http://ws.apache.org/axis2/download.cgi。很有趣,在apache 的Web Service 的Project目录下面还看不到AXIS2。要下那个binary的版本,因为里面有例程。 第二步:Copy axis2.war到$TOMCAT_HOME/webapps目录下面。Tomcat好像只能用JDK1.4,我在JDK1.5 用不出来。 第三步:打开http://localhost:8080/axis2,就可以看到axis2的Welcome页面了。点一 下Validate和Services,看是不是都没有错误。都没有错误的话,就表示deploy成功了。 那个adminstration页面可以通过上传文件来hot deploy Web service,可以用来remote deploy。 第四步:研究例程。先从"samples/userguide/src"目录下的例程看起。看到写一个web service很简单嘛: public class MyService { public OMElement echo(OMElement element) throws XMLStreamException { //Praparing the OMElement so that it can be attached to another OM Tree. //First the OMElement should be completely build in case it is not fully built and still //some of the xml is in the stream. element.build(); //Secondly the OMElement should be detached from the current OMTree so that it can be attached //some other OM Tree. Once detached the OmTree will remove its connections to this OMElement. element.detach(); return element; } public void ping(OMElement element) throws XMLStreamException { //Do some processing } public void pingF(OMElement element) throws AxisFault{ throw new AxisFault ("Fault being thrown"); }} 看得出来,函数统一使用OMElement作为参数。在META-INF目录下面有个services.xml文件: <service name="MyService"> <description> This is a sample Web Service with two operations,echo and ping. </description> <parameter name="ServiceClass" locked="false">userguide.example1. MyService</parameter> <operation name="echo"> <messageReceiver class="org.apache.axis2.receivers. RawXMLINOutMessageReceiver"/> </operation> <operation name="ping"> <messageReceiver class="org.apache.axis2.receivers. RawXMLINOnlyMessageReceiver"/> </operation></service> 呵呵,也很简单嘛。有返回值的就用RawXMLINOutMessageReceiver, 没返回值的就用RawXMLINOnlyMessageReceiver。把它们编译(要把axis2的jar写到classpath里去)打包压到 MyService.aar,包里文件目录如下: ./\META-INF/services.xml./userguide/example1/MyService.class 把MyService.aar拷贝到$ TOMCAT_HOME/webapps/axis2/WEB-INF/services,然后去点一下http://localhost: 8080/axis2页面上的Services,也就是http://localhost:8080/axis2/listServices.jsp,就 可以看到MySer

阅读全文(6610) | 回复(2) | 编辑 | 精华

 


回复:axis2安装步骤
topesk(游客)发表评论于2009/6/29 16:46:12

很好,感谢:)

个人主页 | 引用回复 | 主人回复 | 返回 | 编辑 | 删除

 


回复:axis2安装步骤
滴水涟漪(游客)发表评论于2011/5/6 12:57:29

参数必须用OMElement 吗? 客户端怎么写啊?

 


» 1 »

发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)

 
 



The Neurotic Fishbowl

.: 公告


Bloginess

«September 2025»
123456
78910111213
14151617181920
21222324252627
282930

.: 我的分类(专题)

首页(31)
原创(9)
Ajax技术(1)
随笔(1)
web Server技术(6)


In the Bowl

.: 最新日志

NewsBar真的能赚钱吗?
学习蜡烛图
2009-02-19(汇市报道)
2009-2-18
正式进入汇市
jsp上传图片
一个MM搞笑的Google搜索记录
两头猪的精典对白
一个未婚男人的自述
寂寞而高贵的武士-----野蛮人(一)


.: 最新回复

回复:axis2安装步骤
回复:axis2安装步骤
回复:安装序列号集锦
回复:七大人物套装的背景知识
回复:一个未婚男人的自述
回复:2009-02-19


The Fishkeeper
blog名称:狂飙的蜗牛
日志总数:31
评论数量:19
留言数量:0
访问次数:158618
建立时间:2006年6月13日



Text Me

.: 留言板

签写新留言


Other Fish in the Sea

.: 链接


 pandaboss.bolg.sohu.com




站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.047 second(s), page refreshed 144787190 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号