一、安装axis1.4项目
1-下载axis-bin-1_4.zip并解压到E:\tools\axis-1_4
2-复制E:\tools\axis-1_4\webapps\axis目录到tomcat的webapps目录中
3-启动tomcat后在浏览器中输入http://127.0.0.1:8080/axis后看到如下图信息则说明安装成功
二、发布WebService
1-编写如下java代码
1
2
3
4
5
6
7
8
9
|
package
songjy.com.cn;
public
class
HelloAxis {
public
String hello(String name){
return
"您好,"
+ name;
}
}
|
将编译后的class文件复制到axis\WEB-INF\classes目录中
2-在axis\WEB-INF编写deploy.wsdd文件,如下:
1
2
3
4
5
6
7
8
9
|
<
deployment
xmlns
=
"http://xml.apache.org/axis/wsdd/"
xmlns:java
=
"http://xml.apache.org/axis/wsdd/providers/java"
>
<
service
name
=
"Hello"
provider
=
"java:RPC"
>
<
parameter
name
=
"className"
value
=
"songjy.com.cn.HelloAxis"
/>
<
parameter
name
=
"allowedMethods"
value
=
"*"
/>
<
parameter
name
=
"scope"
value
=
"request"
/>
</
service
>
</
deployment
>
|
4-重新启动tomcat,在浏览器中输入http://127.0.0.1:8080/axis/services/Hello?wsdl即可看到发布的效果