我不知道错误发生在哪里。我检查了我的Axis2.xml
,我已经安装了最新的Axis2 API。我目前正在使用Apache Tomcat 8和JDK 1.8进行开发。
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)
4条答案
按热度按时间e37o9pze1#
我也有同样的问题
我通过如下方式更新WSDL版本来解决这个问题
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
services.xml示例
g6baxovj2#
面对同样的问题。对WEB-INF->services->MyService -> META-INF -> services.xml进行以下更改
发件人:
收件人:
gkl3eglg3#
是的。我最终发现在Axis2.xml中我们需要添加
<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" />
这段代码使它工作。我不知道为什么这是重要的,而不是默认
<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"/>
。感谢大家的及时回复。真的帮了我很大的忙,让我明白了该做什么。
c3frrgcw4#
消息接收者的设置对我来说在'Axis 1.8.2'中不再起作用,所以解决方案也是设置名称空间: