Introduction: Axis is the next open source WebService development component of Apache.
L Development Tools Download:
- 1. java EE version of Eclipse. : http://www.eclipse.org/downloads/
- 2. Axis2. : http://axis.apache.org/axis2/java/core/download.cgi
- 3. Eclipse's two Axis2 plugins:
Axis2_codegen_wizard
Axis2_service_archiver.
: http://axis.apache.org/axis2/java/core/tools/index.html
- 4. Tomcat server. (eg: apache-tomcat-6.0.14.exe)
L Eclipse Install axis2 plugin:
Unzip the downloaded plugin tarball, copy the jar files from the extracted directory to the Dropins directory under Eclipse, restart Eclipse, click File-new-other, if you see Axis2 Wizards, the plugin installation is successful.
L installation Axis2:
Download Axis2 war distribution and unzip, put Axis2 under%tomcat_home%/webapps, start Tomcat,http://localhost:port/axis2, the corresponding page appears, The AXIS2 installation is successful.
L Project Engineering Development:
Create a project, a package, a class, and then write the implementation method.
L Release WebService
- 1. Click Eclipse's File-new-other, open Axis2 Wizards, select Axis2 Service archiver, then next;
- 2. Select the class file location, which is the classpath, note: Choose only the Classes directory, not the folder path of the package, such as the class file path as follows:
Then fill in the E:\workspace\Eclipse\FirstWebService\bin (select the directory of the. class file) (Note: To package each class into a corresponding service instead of the entire project), then next;
- 3. Select Skip WSDL, then next;
- 4. all the way next to select the service XML file to is included in the service archive, tick generate Theservice XML Automatica lly;
- 5. Service name-Fill in your service name (optionally named, can indicate the meaning, later when the URL to access the service name / corresponding class written in the back / The corresponding method name is written in the following), class name-fill in the name of the classes, to include the package name, such as the project directory as follows:
Then fill in the Com.java.firstwebservice.CalculateService, click Load, tick Search decleared methods only, confirm the error, click Next;
- 6. Output file location fill in the%tomcat_home%/webapps\axis2\web-inf\services, then click Finish, then WebService published successfully;
- 7. then go to%tomcat_home%/webapps/axis2/web-inf/services to see if there is more than one. aar file;
- 8. access the Http://localhost:port/axis2/services/class name? wsdl can see the generated WSDL file.
Native directory:
D:\Program Files\apache Software Foundation\tomcat 6.0\webapps\axis2\web-inf\services
Eclipse in Axis2 release WebService