1.官方下载地址:http://axis.apache.org/axis2/java/core/download.html
官方文档:http://ws.apache.org/axis2/1_0/userguide.html
axis2 文档翻译:http://blog.csdn.net/tuwen/article/details/1816239
axis2-1.7.4-bin.zip里有axis2的jar包。 axis2-1.7.4-src.zip里是源代码。 axis2-1.7.4-war.zip里是axis的管理平台,放到tomcat可直接使用。
3.两种方法:
(1)解压 axis2-1.7.4-bin.zip将axis2下面的conf、repository下的modules和services复制到WEB-INF目录
(2)将axis2-1.7.4-war.zip 解压的axis2-1.7.4-war放入tomcat执行 生成文件路径如下
将axis2-web(管理页面) 文件夹放到项目WebRoot下和WEB-INF下的conf、modules和services复制到项目WEB-INF目录
conf下面只需要axis2.xml文件
3.最后在services下面新建一个文件夹,文件名随意,再在下面新建META-INF目录,里面存放自己的services.xml,里面配置自己的服务信息
<?xml version="1.0" encoding="UTF-8"?>
<serviceGroup>
<!-- name属性配置WebService的名称 -->
<service name="OpenService">
<description>OpenService</description>
<parameter name="ServiceObjectSupplier">
org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
</parameter>
<!-- name固定= SpringBeanName-->
<!-- ServiceClass为spring容器内管理的webservice接口类名称-->
<parameter name="SpringBeanName">ServiceClass</parameter>
<!-- ServiceClass属性配置提供WebService服务类的全类名 -->
<!-- <parameter name="ServiceClass">com.webservice.WlyOpenServiceImpl</parameter> -->
<!--false 默认访问address location 为服务器ip地址 -->
<!-- <parameter name="modifyUserWSDLPortAddress">false</parameter> -->
<!-- 下面两个operation是webservice类中的接口 通过测试去掉也可以 -->
<operation name="SaveExamImages">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
<operation name="CustomerCheckItem">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
</messageReceivers>
</service>
</serviceGroup>
4.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>
axis的管理平台:http://localhost:8080/services/listServices wsdl接口 地址:http://localhost:8080/services/OpenService?wsdl