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



I am unable to figure out where the error is occurring. I checked my Axis2.xml and I have installed the latest Axis2 API. I am currently using Apache Tomcat 8 and JDK 1.8 for development.

Exception in thread "main" org.apache.axis2.AxisFault: The ServiceClass object does not implement the required method in the following form: OMElement add(OMElement e)
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:508)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:368)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:414)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:150)
    at com.test.axis2.AddOperatorStub.add(AddOperatorStub.java:181)
    at com.test.axis2.client.AddClientApp.main(AddClientApp.java:29)
share improve this question
 
 
Maybe you could add some extra info about what do you do and what do you want to do (some code snippet, when/where this error occours, etc.) –  Kacu  Mar 30 '16 at 21:30
 
Hi I am trying to run a sample web service application. I have created the server and I am exposing the service using my client to run a simple method to add 2 nos. But instead it is throwing this error. I have used this link to create my application. youtube.com/watch?v=lgY0pLadraE . I am able to the most part except the last part wherein I have to run as a Java Application. –  dodger  Mar 30 '16 at 21:42
 
There is a problem with your AddOperatorStub.add(). Do you pass two integers or an object into this method?–  Kacu  Mar 30 '16 at 22:07
 
Yeah I did. I finally figured out that in Axis2.xml we need to add <messageReceiver mep="w3.org/ns/wsdl/in-only"; class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiv‌​er" /> <messageReceiver mep="w3.org/ns/wsdl/in-out"; class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" /> –  dodger Apr 1 '16 at 15:33 
 
This snippet to make it work. I am not sure why this is important instead of default <messageReceiver mep="w3.org/ns/wsdl/in-only"; class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceive‌​r"/> <messageReceiver mep="w3.org/ns/wsdl/in-out"; class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver‌​"/>. –  dodger  Apr 1 '16 at 15:36

3 Answers

I had the same issue

I solved it by updating WSDL Version as follows

http://www.w3.org/2004/08/wsdl/in-only --> http://www.w3.org/ns/wsdl/in-only

&

http://www.w3.org/2004/08/wsdl/in-out --> 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>
share improve this answer
 
 
so is it the problem with the wsdl version ? I haven't been able to figure out the real issue here –  dodger  Jun 16 '16 at 16:34 
 
This worked for me what was the root cause? –  Vineeth Bhaskaran  Sep 24 '16 at 10:48

Faced the same issue. Made the below change to the WEB-INF->services->MyService -> META-INF -> services.xml

From:

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

To:

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

share improve this answer
 
 
It's the same with other answer –  Danh  Dec 30 '16 at 3:23
up vote 1 down vote accepted

Yeah I did. I finally figured out that in Axis2.xml we need to add

<messageReceiver mep="w3.org/ns/wsdl/in-only"; class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" /> <messageReceiver mep="w3.org/ns/wsdl/in-out"; class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />

This snippet to make it work. I am not sure why this is important instead of default

<messageReceiver mep="w3.org/ns/wsdl/in-only"; class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/> <messageReceiver mep="w3.org/ns/wsdl/in-out"; class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>.

Thanks everyone for your prompt replies. Really helped me a lot to figure out what had to be done.

share improve this answer

 

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.

share improve this answer
 
 
Hi Andreas! Thanks for your response, i've already tried that too, didn't change the result. I've red also the release notes and upgraded to 1.7.1 because of the problems found in 1.7.0, and managed to make it work. –  Vai B.  Mar 2 '16 at 9:45
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值