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

来源:互联网 发布:韩国看视频软件 编辑:程序博客网 时间:2024/06/05 18:53


0down votefavorite

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)
shareimprove 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" /> – dodgerApr 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

activeoldestvotes
up vote7down vote

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>
shareimprove 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
up vote2down vote

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>

shareimprove this answer
 
 
It's the same with other answer – Danh Dec 30 '16 at 3:23
up vote1down voteaccepted

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.

shareimprove this answer

 
up vote2down vote

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.

shareimprove 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
原创粉丝点击