我比较懒惰,不想把user guide全部翻译,就记录一些点吧。
Axis2是全新设计的,在2004年的“Axis峰会”上,大家决定采用新的架构来让Axis更加的富有弹性,更有效率,并且更加的可配置。Axis2现在具有的一些feature:
Speed
Low memory foot print
AXIOM - AXis Object Model
Hot Deployment
Asynchronous Web Services
MEP Support - Message Exchange Patterns
Flexibility
Stability
Component-oriented deployment
Transport framework
WSDL 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,就可以看到MyService已经被列出来了。
分享到:
相关推荐
共四个文件,都是最先版的,希望可以帮助大家。axis2-eclipse-service-archiver-wizard和axis2-eclipse-codegen-wizard和axis2-1.6.1-bin和axis2-1.6.1-war
目前axis2最高版本是2.0以上的版本,但是eclipse和myeclipse都不支持,无奈只能使用低版本的插件1.6.3;经实验,可以安装成功;...axis2-eclipse-service-plugin-1.6.3.zip axis2-eclipse-codegen-plugin-1.6.3.zip
绝对可以用,里面配有myeclipse10安装AXIS2插件的步骤,希望大家工作愉快,谢谢,给好评哦
axis2-eclipse-codegen-plugin-1.6.2+axis2-eclipse-service-plugin-1.6.2
axis2 webservice 服务端jar包: -->axis2-kernel-1.6.1.jar -->axis2-spring-1.6.1.jar -->axis2-transport-http-1.6.1.jar -->XmlSchema-1.4.7.jar -->wsdl4j-1.6.2.jar -->axiom-api-1.2.12.jar -->axiom...
axis2-eclipse-codegen-plugin-1.6.0和axis2-eclipse-service-plugin-1.6.0有关jar包下载,解压后直接将这两个jar包放到eclips下的plugins目录下,重启eclipse即可
标签:axis2.eclipse.service.plugin-1.5.jar,axis2.eclipse.service.plugin,1.5,jar包下载,依赖包
axis2-eclipse-codegen-plugin-1.6.2.zip和axis2-eclipse-service-plugin-1.6.2.zip,解压即可使用
axis2-eclipse-service-archiver-wizard.zip
1、axis2相关jar包如下: axiom-api-1.2.10.jar axiom-dom-1.2.10.jar axiom-impl-1.2.10.jar axis2-adb-1.5.4.jar axis2-adb-codegen-1.5.4.jar axis2-codegen-1.5.4.jar axis2-corba-1.5.4.jar axis2-fastinfoset-...
web service axis2-1.7.4
axis2-1.6.2-war、axis2-1.6.1-war、axis2-1.6.2-bin
用于axis2开发的一个必不可少的包,开发时需要把包安置在eclipse下
axis2-1.6.0-bin和axis2-1.6.0-war相关资源
axisAxis2学习教程-全面学习AXISAxis2学习教程-全面学习AXIS
axis-imageshtml5-3d-mult-axis-imageshtml5-3d-mult-axis-imageshtml5-3d-mult-axis-images
axis2-eclipse-service-plugin-1.5.4.zip
Axis2 是 Apache 提供的一款第三方 Web Services 引擎,与其前身 Apache Axis 相比, ... Web Service 是现在最适合实现 SOA 的技术,而 Axis2 是目前实现 Web Service 的一种相对比较成熟和流行的技术框架(架构)。
标签:axis2.eclipse.service.plugin-1.5-sources.jar,axis2.eclipse.service.plugin,1.5,sources,jar包下载,依赖包
axis2-eclipse-service-plugin-1.7.4.zip eclipse插件