背景:
1个运营商厂家开发人员离职,我们为了上线对接接口,迁就对方客户端调用。对方客户端框架用的是xfire.调用方式基本为:
Service serviceModel = new ObjectServiceFactory().create(EOMSProcessSheet.class);
XFire xfire = XFireFactory.newInstance().getXFire();
XFireProxyFactory factory = new XFireProxyFactory(xfire);
String serviceUrl = "http://127.0.0.1:8080/EOMS/services/OSSProcessSheet";
EOMSProcessSheet client = null;
try {
//factory.create(service, transport, url);
//factory.create(service, transport, url)
client = (EOMSProcessSheet) factory.create(serviceModel, serviceUrl);
} catch (MalformedURLException e) {
System.out.println("Client call webservice has exception: "+ e.toString());
}
String result1 = client.isAlive("4444", "7777");
服务器联调的时候会报数组越界:具体错误出现在
![](https://i-blog.csdnimg.cn/blog_migrate/b4cdb410602f53d600fec4a05a2f3b22.png)
DEBUG的时候 发现参数解析有问题,解析代码如下
![](https://i-blog.csdnimg.cn/blog_migrate/fb9b4832db2f3555980e13b06ee4e552.png)
![](https://i-blog.csdnimg.cn/blog_migrate/4662ab58c9d6876597429cc98cf87c0f.png)
debug的时候修改参数未 <arg0></arg0>就没问题了 。无奈准备改源代码的时候,下了一个比较old的ADB包,部署上去,问题都解决了。
这个接口问题查询给了一个
教训是 :即时是有名的开源包,也不是总是向前兼容的。特别是对比较老的技术,新版本jar包不一定能够适配。