1.下载 axis2-1.6.2-bin.zip axis2-1.6.2-war.zip
2.将axis2.war拷贝到apache-tomcat-6.0.35\webapps下,启动Tomcat.
3. http://localhost:8080/axis2/
3.1编写Java类
public class DemoService { public String speakToLove(String lover){ return lover+" I Love You !"; } }
3.2将DemoService.class拷贝到apache-tomcat-6.0.35\webapps\axis2\WEB-INF\pojo下(pojo自己新建),重启Tomcat
4.点击Services
5.测试Webservice
http://localhost:8080/axis2/services/DemoService/speakToLove?lover=MM
- <ns:speakToLoveResponse xmlns:ns="http://ws.apache.org/axis2"> <return>MM I Love You !</return> </ns:speakToLoveResponse>
参考WebService大讲堂之Axis2 http://www.blogjava.net/nokiaguy/archive/2009/01/02/249556.html