今天遇到一件诡异的事情,打好的同一个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的解释:

Apache Axis2用户指引-介绍服务

Web 服务与 Axis2 体系结构

The ServiceClass object does not implement the required method in the following form: OMElement sayHello(OMElement e)的更多相关文章

  1. Axis2 服务器端抛出ServiceClass object does not implement问题解决方法

    在用eclipse配合Axis2进行开发的时候,编译通过,启动tomcat也顺利,但是就是在调用服务器端的服务时,会抛出: The ServiceClass object does not imple ...

  2. django运行报错TypeError: object supporting the buffer API required

    运行django项目报错:TypeError: object supporting the buffer API required 解决方案: 将settings.py中数据库的密码改成字符串格式 源 ...

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

  4. IE11 - Object doesn't support property or method 'includes'

    IE不支持字符串的includes()方法:可以用indexOf()替换: includes()方法返回true和false; var str = "asdklmn": if(st ...

  5. [JavaWebService-axis]-环境搭建

    一.准备 1.下载环境需要的zip包 JDK Eclipse axis(http://axis.apache.org/axis2/java/core/download.html)(axis2-1.7. ...

  6. JavaScript设计模式——前奏

    Function.prototype.method = function(name,fn){ this.prototype[name] = fn; } var Anim = function(){ / ...

  7. 深入js的面向对象学习篇——温故知新(一)

    在学习设计模式前必须要知道和掌握的***. 为类添加新方法: Function.prototype.method = function(name,fn) { this.prototype[name] ...

  8. javascript设计模式2

    接口:利 固化一部分代码 弊 丧失js的灵活性 在JavaScript中模仿接口 /* interface Composite{ function add(child); function remov ...

  9. 读书笔记之 - javascript 设计模式 - 接口、封装和链式调用

    javascript 采用设计模式主要有下面的三方面原因: 可维护性:设计模式有助于降低模块之间的耦合程度.这使代码进行重构和换用不同的模块变得容易,也使程序员在大型项目中合作变得容易. 沟通:设计模 ...

随机推荐

  1. 安装VVDocumenter-Xcode-master (Xcode 7.1)的过程

    下载地址: http://pan.baidu.com/s/1boxvewB 1.首先下载解压压缩包打开VVDocumenter工程,编译一遍(快捷键com+B) 2.在finder里面的应用程序,找到 ...

  2. 找不到或无法加载主类 org.codehaus.plexus.classworlds.launcher.Launcher

    配置PATH的时候,把$PATH写在后面,比如下面这样 export PATH=$MAVEN_HOME/bin:$PATH

  3. 关于ajax请求数据后,数据本身的js失效的一些想法

    今天遇到一个头疼的问题.我做一个左右翻页效果(客户要求能够无限翻页),所以只能动态请求数据,进行局部刷新操作. 这时候问题就出来了,当我请求翻页的时候,数据通过js填充到div里面,但这些数据,自身带 ...

  4. 让div中的table居中

    div 标签上写  style="text-align:center" div中的table中写 style="margin:auto;"  <table ...

  5. svn错误

    在myEclipse客户端第一次连到SVN时,如:svn://192.168.20.242/MyProject1,然后要求输入用户名和密码.如果用户名和密码输入出错了,强行确定后.问题来了!会出现,以 ...

  6. poj邮局1160

    题目是给出V个村庄,取出P个做为邮局,要求每个村庄到邮局的距离和最小. 先考虑只有一个邮局的情况,不管你怎么放邮局和最小的情况总是在中点的位置. 再来考虑P>1的情况: 假设P-1个邮局已经选好 ...

  7. Effective Java 13 Minimize the accessibility of classes and members

    Information hiding is important for many reasons, most of which stem from the fact that it decouples ...

  8. .net 中使用配置文件需注意引用dll文件

    需要用到sqlhelper和配置文件时发现加了using System.Configuration;还是不能用ConfigurationManager. 查了几遍msdn未果,直接百度才发现还需要引用 ...

  9. linux内核调优参考

    对于新部署的机器,需要做一些基本的调优操作,以更改一些默认配置带来的性能问题 1 修改打开文件数 root@mysql:/data/tools/db# vim /etc/security/limits ...

  10. 第二章 Mysql 数据类型简介--(整数类型、浮点数类型和定点数类型,日期与时间类型,字符串类型,二进制类型)

    第一节:整数类型.浮点数类型和定点数类型 1,整数类型 2,浮点数类型和定点数类型 M 表示:数据的总长度(不包括小数点):D 表示:小数位:例如 decimal(5,2) 123.45存入数据的时候 ...