标签:
1.首先下载axis2.war文件,将里面的conf,lib,modules三个文件夹复制到项目的WEB-INF,删除掉lib里面的txt文件:
2.在web-inf下面建立services目录,并在service目录下面建立META-INF,然后再改目录下新建services.xml
3.开发java类:
package xihuyu.service; public class { public String sayHello(String name) { return "hello " + name; } }
4.编写services.xml
<service name="AxisService"> <description>AxisService</description> <parameter name="ServiceClass"> xihuyu.service.Calculate </parameter> <operation name="sayHello"> <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" /> </operation> </service>
5.在web.xml配置axis2
<servlet> <servlet-name>AxisServlet</servlet-name> <servlet-class> org.apache.axis2.transport.http.AxisServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>AxisServlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping>
6.启动我们的web项目,浏览器输入:http://localhost:8177/MyAxis/services/AxisService?wsdl
可以看到访问我们的wsdl成功了
标签:
原文地址:http://www.cnblogs.com/snowflakes/p/4720640.html