The ServiceClass object does not implement the required method in the following form: OMElement sayHello(OMElement e)
今天遇到一件诡异的事情,打好的同一个aar包,丢到测试环境tomcat,使用soapui测试,正常反馈结果。
丢到本地tomcat,使用soapui测试,始终报以下错误。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>The ServiceClass object does not implement the required method in the following form: OMElement sayHello(OMElement e)</faultstring>
<detail/>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
查找该错误,所有的解决方案均指向需要在aar工程中配置service.xml文件。
但是,我是同一个包啊,测试环境不需要service.xml就能正确运行,没道理放到本地环境中不行啊。
于是再将测试环境中的axis2.xml替换掉本地的axis2.xml,发现serverlist中一个服务都没有了。
后来猜测是不是版本的原因,查看测试环境中的版本,axis2 1.6.0,本地版本axis2 1.7.3.
于是下载1.6.0至本地环境,无需配置service.xml即能正确运行soapui进行测试。
这个太坑了,新版本竟然不支持不配置service的方式。
修改与2017/04/19
抱歉,前面的解释没经过仔细的试验,在经过试验之后得出以下结论
生成aar包的Service Archive plugin的版本需要不高于服务器上运行时的axis2的版本才能正确的运行服务。

建议:服务器运行时版本与生成服务包的版本保持一致。
如果不确定服务器运行时的axis2版本,可以通过webapps/axis2/WEB-INF/services查看,或者使用http://server:port/axis2/services/Version?wsdl获取版本号。
修改于2017/04/20
上述问题经过再次在java代码中使用RPCClient的方式调用。
分别使用
a.先打jar包,再改后缀为aar,最后手工编辑services.xml的方式生成aar包(手工生成AXIS2的aar文件)
b.直接使用Serveice Archive plugin插件生成aar包的方式
进行了测试。
测试结果如下。
a.

b.
。
通过对比发现使用,
插件1.6.2生成的service.xml内容如下:
<service name="HelloServer" >
<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">com.hongbo.server.HelloServer</parameter>
</service>
插件1.7.4生成的service.xml内容如下:
<service name="HelloServer" >
<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">com.hongbo.server.HelloServer</parameter>
</service>
关于MEP的解释:
Web 服务与 Axis2 体系结构
The ServiceClass object does not implement the required method in the following form: OMElement sayHello(OMElement e)的更多相关文章
- Axis2 服务器端抛出ServiceClass object does not implement问题解决方法
在用eclipse配合Axis2进行开发的时候,编译通过,启动tomcat也顺利,但是就是在调用服务器端的服务时,会抛出: The ServiceClass object does not imple ...
- django运行报错TypeError: object supporting the buffer API required
运行django项目报错:TypeError: object supporting the buffer API required 解决方案: 将settings.py中数据库的密码改成字符串格式 源 ...
- GraphQL: Object doesn't support property or method 'from'
From: https://github.com/graphql/graphiql/issues/688 psyCodelist commented 11 days ago Hi, Thank you ...
- IE11 - Object doesn't support property or method 'includes'
IE不支持字符串的includes()方法:可以用indexOf()替换: includes()方法返回true和false; var str = "asdklmn": if(st ...
- [JavaWebService-axis]-环境搭建
一.准备 1.下载环境需要的zip包 JDK Eclipse axis(http://axis.apache.org/axis2/java/core/download.html)(axis2-1.7. ...
- JavaScript设计模式——前奏
Function.prototype.method = function(name,fn){ this.prototype[name] = fn; } var Anim = function(){ / ...
- 深入js的面向对象学习篇——温故知新(一)
在学习设计模式前必须要知道和掌握的***. 为类添加新方法: Function.prototype.method = function(name,fn) { this.prototype[name] ...
- javascript设计模式2
接口:利 固化一部分代码 弊 丧失js的灵活性 在JavaScript中模仿接口 /* interface Composite{ function add(child); function remov ...
- 读书笔记之 - javascript 设计模式 - 接口、封装和链式调用
javascript 采用设计模式主要有下面的三方面原因: 可维护性:设计模式有助于降低模块之间的耦合程度.这使代码进行重构和换用不同的模块变得容易,也使程序员在大型项目中合作变得容易. 沟通:设计模 ...
随机推荐
- 可展开的列表组件——ExpandableListView深入解析
可展开的列表组件--ExpandableListView深入解析 一.知识点 1.ExpandableListView常用XML属性 2.ExpandableListView继承BaseExpanda ...
- Spring(四)Bean注入方试
一.构造方法注入 定义:通过构造函数来完成依赖关系的设定 优缺点: 在构造对象的同时,完成依赖关系的建立 如果关联的对象很多,那和不得不在构造方法上加入过多的参数 基中有index:如果指定索引从0开 ...
- 1、IOS开发--iPad之仿制QQ空间(登录界面搭建+登录逻辑实现)
开始搭建登录界面 登录界面效果图: 相关的图片资源下载百度云备份链接: http://pan.baidu.com/s/1o71cvMU 密码: 2h7e 步骤开始: 设置辅助窗口的位置在下方 快捷键o ...
- sublime text2 汉化
1.下载Sublime-Text-2中文包.zip 链接:http://pan.baidu.com/s/1mgYRW9q 密码:8ks6 2.将 Sublime-Text-2中文包.zip 解压,并将 ...
- mysql给数据库授权 GRANT ALL PRIVILEGES ON
mysql> grant 权限1,权限2,…权限n on 数据库名称.表名称 to 用户名@用户地址 identified by ‘连接口令’; show grants for mustang@ ...
- 每日Scrum--No.4
Yesterday:学习迪杰斯特拉算法并进行简单的编写代码 Today:继续编写代码 Problem:变量名的定义出错,造成调用的时候出错,不过改过来就好了.算法的编写不全面,漏掉个别语句,如在调试的 ...
- c++基础回顾
#include <iostream> #include <vector> #include <string> int main(int argc, const c ...
- html标题_段落_换行_水平线_特殊字符
标题 <h1>一级标题</h1> <h2 align="对齐方式">二级标题</h2> 对齐方式有left,center,right ...
- powerdesigner设置表主键列为自动增长
powerdesigner 版本12.5 创建表就不说了.下面开始介绍设置自动增长列. 1 在表视图的列上创建.双击表视图,打开table properties ———>columens ,双击 ...
- C#与MATLAB之间传递参数
本文转载自http://www.cr173.com/html/10249_1.html MWNumericArray是MWArray和c#中数据的中间类,怎么用?怎样在C参数? a.double型.i ...