Step 1: Add a must-have class library
List in under:
ActiVation.jar
Axis-ant.jar
Axis.jar
Commons-discovery.jar
Commons-logging.jar
Jaxrpc.jar
Log4j-1.2.8.jar
Mail.jar (optional)
saaj.jar
Wsdl4j.jar
Xmlsec.jar (optional)
Step 2: Modify Web.xml
1. Add a servlet definition
Org.apache.axis.transport.http.axisservlet
servlet-class>
servlet>
Org.apache.axis.transport.http.adminservlet
servlet-class>
servlet>
Org.apache.axis.monitor.soapmonitorService
servlet-class>
init-param>
servlet>
2. Add a servlet mapping
servlet-maping>
servlet-maping>
servlet-maping>
servlet-maping>
servlet-maping>
->
3. Add MIME type
mime-mapping>
mime-mapping>
Step 3: Write a WebService program
Example: Add file hello.jw in the application directory
Source code is under:
Public class hello {
Private static int Time = 1;
Public String Hello (String Name) {
IF (name == null) {
Name = ""
}
Return "Hello" Name ", welcome to the world of Web services. Today is" new java.util.date ();
}
}
No need to compile,
http://localhost/ws/hello.jws? WSDL is the WebService address, access to the execution