The ServiceClass object does not implement the required method in the following form: OMElement login(OMElement e)

感情迁移 提交于 2019-12-21 20:45:48

问题


After i upgraded the axis2 from 1.6.2 to 1.7.0 i get the following exception:

"The ServiceClass object does not implement the required method in the following form: OMElement"

most of the answers I found suggest to set the rpc message receivers in services.xml which i already had from previous version:

<service name="LogService" scope="transportsession">
<description>
    Log
</description>
<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>
<parameter name="ServiceClass">
    com.viaMEDICI.viaWS.services.LogService
</parameter>

Any other ideas what could have gone wrong? List services and the wsdl looks fine.

LE:

something different is the namespace before was "axis2ns2" now it is "nsoMZdG". No idea where could this come from.. and also i don't get all parameters by calling the ws restful and just only the first one...


回答1:


As noted in the Apache Axis2 1.7.0 release notes, the http://www.w3.org/2004/08/wsdl/XXX MEP URIs are no longer supported. Use http://www.w3.org/ns/wsdl/XXX instead.




回答2:


I had the same issue

I solved it by updating http://www.w3.org/2004/08/wsdl/in-only to http://www.w3.org/ns/wsdl/in-only and http://www.w3.org/2004/08/wsdl/in-out to http://www.w3.org/ns/wsdl/in-out

Example services.xml

Earlier

<service name="Axis2HelloWorld" >
    <Description>
        Please Type your service description here
    </Description>
    <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>
    <parameter name="ServiceClass" locked="false">com.ciber.webservices.Axis2HelloWorld</parameter>
</service>

New

<service name="Axis2HelloWorld" >
    <Description>
        Please Type your service description here
    </Description>
    <messageReceivers>
        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
        <messageReceiver  mep="http://www.w3.org/ns/wsdl/in-out"  class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </messageReceivers>
    <parameter name="ServiceClass" locked="false">com.ciber.webservices.Axis2HelloWorld</parameter>
</service>



回答3:


update to axis2 1.7.1 solved this problem, but there now i discovered other problems... like this one:

[2016-03-02 11:39:47] [ERROR] [org.apache.axis2.rpc.receivers.RPCMessageReceiver] - null 
java.lang.NullPointerException
at org.apache.axis2.databinding.utils.BeanUtil.addInstanceTypeAttribute(BeanUtil.java:1316)
at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:390)
at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:88)
at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(ADBXMLStreamReaderImpl.java:989)
at org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:829)
at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:71)


来源:https://stackoverflow.com/questions/35720181/the-serviceclass-object-does-not-implement-the-required-method-in-the-following

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!