webapp中嵌入的Axis2的简单axis2.xml [英] Simple axis2.xml for Axis2 embedded in webapp

查看:305
本文介绍了webapp中嵌入的Axis2的简单axis2.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Maven开发具有Axis2嵌入式Web服务的Web应用程序. 服务实现是具有RPC样式交互作用的POJO,目标应用服务器是运行Axis2 servlet的Tomcat.

"Hello world"工作正常,但现在我需要在axis2.xml文件(位于WEB-INF/conf下)中配置一些全局axis2设置.

请为此常见环境提供或指向axis2.xml的简单配置. 从二进制分发中获取的默认值激活了太多功能(hotdeploy?),并且还会导致此问题:

<soapenv:Reason>
    <soapenv:Text xml:lang="en-US">
        The ServiceClass object does not implement the required method 
        in the following form: OMElement ping(OMElement e)
    </soapenv:Text>
</soapenv:Reason>

作为参考: http://axis.apache. org/axis2/java/core/docs/servlet-transport.html 说以这种方式配置servlet传输,但是并不能解决问题.

<transportReceiver name="http" class="org.apache.axis2.transport.http.AxisServletListener"/>

解决方案

显然,问题在于默认的axis2.xml设置了原始xml messageReceivers,而不是RPC的.

尝试将其添加到已开发服务的services.xml中,应解决此问题.

<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>

I am developing a webapp with an embedded webservice with Axis2 using Maven. The service implementation is a POJO with RPC-style interaction, the target appserver is Tomcat running the Axis2 servlet.

The "Hello world" works but now I need to configure some global axis2 settings in the axis2.xml file (placed under WEB-INF/conf).

Please provide or point to a simple configuration for axis2.xml for this common environment. The default taken from the binary distribution has too many features activated (hotdeploy?) and also causes this problem:

<soapenv:Reason>
    <soapenv:Text xml:lang="en-US">
        The ServiceClass object does not implement the required method 
        in the following form: OMElement ping(OMElement e)
    </soapenv:Text>
</soapenv:Reason>

As a reference: http://axis.apache.org/axis2/java/core/docs/servlet-transport.html says to configure the servlet transport in this way, but it does not solve the issue.

<transportReceiver name="http" class="org.apache.axis2.transport.http.AxisServletListener"/>

解决方案

Apparently the problem is that the default axis2.xml sets raw xml messageReceivers, instead of the RPC ones.

Try to add this to the services.xml for the developed service, should fix the problem.

<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>

这篇关于webapp中嵌入的Axis2的简单axis2.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆