1. 安装JDK1.5, 配置系统环境变量:
下载安装JDK后, 设置环境变量:
JAVA_HOME=C:/Program Files/Java/jdk1.5.0_02
Path=%Path%;%JAVA_HOME%/bin(这里的%Path%指你系统已经有的一系列配置)
CLASSPATH=%JAVA_HOME%/lib
下载安装JDK后, 设置环境变量:
JAVA_HOME=C:/Program Files/Java/jdk1.5.0_02
Path=%Path%;%JAVA_HOME%/bin(这里的%Path%指你系统已经有的一系列配置)
CLASSPATH=%JAVA_HOME%/lib
2. 下载axis, 配置系统环境变量:
下载axis后,配置如下:
AXIS_LIB=F:/Java/axis/axis-1_4/lib
然后在CLASSPATH里添加axis的8个jar:
CLASSPATH=%JAVA_HOME%/lib;
%AXIS_LIB%/axis.jar;
%AXIS_LIB%/axis-ant.jar;
%AXIS_LIB%/commons-discovery-0.2.jar;
%AXIS_LIB%/commons-logging-1.0.4.jar;
%AXIS_LIB%/jaxrpc.jar;
%AXIS_LIB%/log4j-1.2.8.jar;
%AXIS_LIB%/saaj.jar;
%AXIS_LIB%/wsdl4j-1.5.1.jar;
3. 添加附加的3个jar:
自己去获取activation.jar, mail.jar, xerces.jar, 放到AXIS_LIB所指的目录下,
然后在CLASSPATH里添加:
CLASSPATH=%JAVA_HOME%/lib;
%AXIS_LIB%/axis.jar;
%AXIS_LIB%/axis-ant.jar;
%AXIS_LIB%/commons-discovery-0.2.jar;
%AXIS_LIB%/commons-logging-1.0.4.jar;
%AXIS_LIB%/jaxrpc.jar;
%AXIS_LIB%/log4j-1.2.8.jar;
%AXIS_LIB%/saaj.jar;
%AXIS_LIB%/wsdl4j-1.5.1.jar;
%AXIS_LIB%/activation.jar;
%AXIS_LIB%/mail.jar;
%AXIS_LIB%/xerces.jar
下载axis后,配置如下:
AXIS_LIB=F:/Java/axis/axis-1_4/lib
然后在CLASSPATH里添加axis的8个jar:
CLASSPATH=%JAVA_HOME%/lib;
%AXIS_LIB%/axis.jar;
%AXIS_LIB%/axis-ant.jar;
%AXIS_LIB%/commons-discovery-0.2.jar;
%AXIS_LIB%/commons-logging-1.0.4.jar;
%AXIS_LIB%/jaxrpc.jar;
%AXIS_LIB%/log4j-1.2.8.jar;
%AXIS_LIB%/saaj.jar;
%AXIS_LIB%/wsdl4j-1.5.1.jar;
3. 添加附加的3个jar:
自己去获取activation.jar, mail.jar, xerces.jar, 放到AXIS_LIB所指的目录下,
然后在CLASSPATH里添加:
CLASSPATH=%JAVA_HOME%/lib;
%AXIS_LIB%/axis.jar;
%AXIS_LIB%/axis-ant.jar;
%AXIS_LIB%/commons-discovery-0.2.jar;
%AXIS_LIB%/commons-logging-1.0.4.jar;
%AXIS_LIB%/jaxrpc.jar;
%AXIS_LIB%/log4j-1.2.8.jar;
%AXIS_LIB%/saaj.jar;
%AXIS_LIB%/wsdl4j-1.5.1.jar;
%AXIS_LIB%/activation.jar;
%AXIS_LIB%/mail.jar;
%AXIS_LIB%/xerces.jar
4. 获取或者自己编写wsdl文件
5. 生成webservice服务器端的代码:
5.1 先看命令的帮助, 在cmd.exe的提示符执行:java org.apache.axis.wsdl.WSDL2Java -h
我可以看到很多选项,其中就有-s和-S
5.2 执行WSDL2Java, 生成skeleton类:
java org.apache.axis.wsdl.WSDL2Java -s -S true BluePower.wsdl
将生成: A skeleton class
An implementation template class
One deploy.wsdd file
One undeploy.wsdd file
5.3 执行WSDL2Java, 不生成skeleton类:
java org.apache.axis.wsdl.WSDL2Java -s BluePower.wsdl
将生成:
An implementation template class
One deploy.wsdd file
One undeploy.wsdd file
(我们发现少了一个A skeleton class)
5.4 名字解释:
Skeleton class:
它是Axis engine 和 the actual service implementation 类之间的一个代理类。
The skeleton contains an implementation of the AddressBook service.
This implementation is either passed into the skeleton on construction,
or an instance of the generated implementation is created.
When the Axis engine calls the skeleton's addEntry method,
it simply delegates the invocation to the real implementation's addEntry method.
Implementation Template class:
它就是我们的实际服务器端的实现代码,我们要在不同的方法里写具体的实现处理。
6. 根据deploy.wsdd生成server-config.wsdd:
有开启tomcat将axis跑起来导致的,如果你axis安装了并开启了tomcat但还是错误,此时你要看你的tomcat端口是不是8080,你部署的axis包名是不是修改过,
5.1 先看命令的帮助, 在cmd.exe的提示符执行:java org.apache.axis.wsdl.WSDL2Java -h
我可以看到很多选项,其中就有-s和-S
5.2 执行WSDL2Java, 生成skeleton类:
java org.apache.axis.wsdl.WSDL2Java -s -S true BluePower.wsdl
将生成: A skeleton class
An implementation template class
One deploy.wsdd file
One undeploy.wsdd file
5.3 执行WSDL2Java, 不生成skeleton类:
java org.apache.axis.wsdl.WSDL2Java -s BluePower.wsdl
将生成:
An implementation template class
One deploy.wsdd file
One undeploy.wsdd file
(我们发现少了一个A skeleton class)
5.4 名字解释:
Skeleton class:
它是Axis engine 和 the actual service implementation 类之间的一个代理类。
The skeleton contains an implementation of the AddressBook service.
This implementation is either passed into the skeleton on construction,
or an instance of the generated implementation is created.
When the Axis engine calls the skeleton's addEntry method,
it simply delegates the invocation to the real implementation's addEntry method.
Implementation Template class:
它就是我们的实际服务器端的实现代码,我们要在不同的方法里写具体的实现处理。
6. 根据deploy.wsdd生成server-config.wsdd:
有开启tomcat将axis跑起来导致的,如果你axis安装了并开启了tomcat但还是错误,此时你要看你的tomcat端口是不是8080,你部署的axis包名是不是修改过,
java org.apache.axis.client.AdminClient -lhttp://地址:端口/context模块/services/AdminService deploy.wsdd 这个命令来生成server-config.wsdd文件。
执行java org.apache.axis.client.AdminClient deploy.wsdd就相当于默认执行java org.apache.axis.client.AdminClient -lhttp://localhost:8080/axis/services/AdminService deploy.wsdd