eclipse jee + axis2 + axis eclipse plugin 开发Web Service

本文详细介绍如何在Eclipse环境中配置Axis2插件的过程,包括下载特定版本的Axis2及必要的辅助工具,调整Eclipse的插件设置,并提供了一个简单的Web服务示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[size=medium]
1.下载 eclipse javaee 版本
2.下载 [color=red]axis2-1.5.6[/color] axis2-1.6.*和目前的插件不匹配
3.下载 axis2-eclipse-service-archiver-wizard-1.4.zip
axis2-eclipse-codegen-wizard-1.4.zip
download site:http://archive.apache.org/dist/ws/axis2/tools/1_4/
4.安装插件:
下载完2个压缩文件后,可以直接把解压后的文件拷贝到eclipse 的 plugins目录中
backport-util-concurrent-3.1.jar 和 geronimo-stax-api_1.0_spec-1.0.1.jar
复制到 eclipse\plugins\Axis2_Codegen_Wizard_1.3.0\lib 文件夹下。
download site:http://www.findjar.com/jar/mule/dependencies/maven2/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar.html
5.修改eclipse\plugins\Axis2_Codegen_Wizard_1.3.0\plugin.xml 文件
在 <runtime> 內加入下面的字串
<library name="lib/geronimo-stax-api_1.0_spec-1.0.1.jar">
<export name="*"/>
</library>
<library name="lib/backport-util-concurrent-3.1.jar">
<export name="*"/>
</library>
6.把Axis2_Codegen_wizard_1.3.0(eclipse/plugins/Axis2_Codegen_wizard_1.3.0)的名字改成Axis2_Codegen_wizard_1.4.0
在plugin.xml中在<plugin>中 把Axis2_Codegen_wizard的version="1.3.0"改成version="1.4.0"
到plugin.xml文件中,保存后重新启动Eclipse即可。[/size]

Developing Web Services Using Apache Axis2 Eclipse Plugins
http://wso2.org/library/1719


package com.ws.service;

public class SayHello {

public String sayHello(String name){
return "Hello , " + name;
}
}



package com.ws.client.test;

import java.rmi.RemoteException;

import org.apache.axis2.AxisFault;

import com.ws.service.client.MyServiceStub;
import com.ws.service.client.MyServiceStub.SayHello;

public class WStest {

public static void main(String args[]){
try {
MyServiceStub stub = new MyServiceStub();
SayHello sayhello = new SayHello();
sayhello.setName("xiewenbo");
String response = stub.sayHello(sayhello).get_return();
System.out.println(response);
} catch (AxisFault e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值