使用Axis开发Web Service程序
1、新建一个Web工程,工程名为“AxisTest”:
2、新建“lib”文件夹,然后把主要JAR包:axis.jar,commons-discovery-0.2.jar,commons-logging-1.0.4.jar,jaxrpc.jar,wsdl4j-1.5.1.jar,saaj.jar;可选包(发布服务及生成客户端程序是要用到的):activation.jar;mail.jar都拷贝到此“lib”文件夹下,并把主要的JAR包添加到工程的classpath中;
3、配置“web.xml”:
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
Apache-Axis
org.apache.axis.transport.http.AxisHTTPSessionListener
AxisServlet
org.apache.axis.transport.http.AxisServlet
AdminServlet
org.apache.axis.transport.http.AdminServlet
100
SOAPMonitorService
org.apache.axis.monitor.SOAPMonitorService
SOAPMonitorPort
5001
100
AxisServlet
/servlet/AxisServlet
AxisServlet
*.jws
AxisServlet
/services/*
SOAPMonitorService
/SOAPMonitor
20
wsdl
text/xml
xsd
text/xml
index.jsp
index.html
index.jws
可参照“axis-1_4\webapps\axis\WEB-INF\web.xml”进行配置;