axis2与spring整合遇到的问题

今天按照网上搜的教程做axis2与spring整合,遇到如下问题:

开始时services.xml配置如下:

<service name="LessonAction">
<!-- <parameter name="ServiceClass">test.service.ServiceOne</parameter> -->
<parameter name="SpringBeanName">serviceOne</parameter> 
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
</service>

启动访问wsdl文档,生成的文档<wsdl:types>是空的,就是没有operation,时下面这样

<?xml version="1.0" encoding="UTF-8"?>


-<wsdl:definitions targetNamespace="http://ws.apache.org/axis2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.apache.org/axis2">


<wsdl:documentation>LessonAction</wsdl:documentation>


<wsdl:types/>


<wsdl:portType name="LessonActionPortType"/>




-<wsdl:binding name="LessonActionSoap11Binding" type="tns:LessonActionPortType">


<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>


</wsdl:binding>




-<wsdl:binding name="LessonActionSoap12Binding" type="tns:LessonActionPortType">


<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>


</wsdl:binding>




-<wsdl:binding name="LessonActionHttpBinding" type="tns:LessonActionPortType">


<http:binding verb="POST"/>


</wsdl:binding>




-<wsdl:service name="LessonAction">




-<wsdl:port name="LessonActionHttpSoap11Endpoint" binding="tns:LessonActionSoap11Binding">


<soap:address location="http://localhost:8080/ImageTransport/services/LessonAction.LessonActionHttpSoap11Endpoint/"/>


</wsdl:port>




-<wsdl:port name="LessonActionHttpSoap12Endpoint" binding="tns:LessonActionSoap12Binding">


<soap12:address location="http://localhost:8080/ImageTransport/services/LessonAction.LessonActionHttpSoap12Endpoint/"/>


</wsdl:port>




-<wsdl:port name="LessonActionHttpEndpoint" binding="tns:LessonActionHttpBinding">


<http:address location="http://localhost:8080/ImageTransport/services/LessonAction.LessonActionHttpEndpoint/"/>


</wsdl:port>


</wsdl:service>


</wsdl:definitions>




后来在bean配置里加上<bean id="applicationContext" class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"/>

services.xml加上

<parameter name="ServiceObjectSupplier" locked="false">
             org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
         </parameter> 

注意这里老的版本是org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier,否则会报Spring context file cannot be located for AxisServlet的错误。

问题解决!!!,在此记录下

网上查到它的功能是通过ServiceObjectSupplier参数指定SpringServletContextObjectSupplier类来获得Spring的ApplicationContext对象


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值