webservice 调用另一个webservice 异常!

何处英雄不杀人 2014-08-19 06:17:03
代码:
public static WebChildResource[] queryChildResourceById(String id){
/* 使用RPC方式调用WebService */
RPCServiceClient serviceClient = null;
try {
serviceClient = new RPCServiceClient();
} catch (AxisFault e) {
e.printStackTrace();
}
if(serviceClient == null){
return null;
}
Options options = serviceClient.getOptions();
/* 指定调用WebService的URL */
EndpointReference targetEPR = new EndpointReference(url);
options.setTo(targetEPR);
/* 指定方法参数 */
Object[] entryArgs = new Object[]{id};
/* 指定方法返回值数据类型的class */
Class[] returnTypes = new Class[]{WebChildResource[].class};
/* 制定调用的命名空间及方法 */
QName opAdd = new QName(namespace, "getChildResource");
/* 调用方法 */
WebChildResource[] childResource = null;
try {
childResource = (WebChildResource[])serviceClient.invokeBlocking(opAdd, entryArgs, returnTypes)[0];
System.out.println(childResource.toString());
} catch (AxisFault e) {
e.printStackTrace();
log.debug("Util>>>queryChildResourceById>>>AxisFault Exception>>>"+e);
}
return childResource;
}

此方法内部调用一个webservice,单独写一个main方法测试没问题,但是将此方法发布到一个webservice,这样就变成在一个webservice中调用另一个webservice,出现异常:
org.apache.axis2.AxisFault: The server did not recognise the action which it received:
然后加了句:options.setAction("getChildResource");异常变为:
org.apache.axis2.AxisFault: Unknow type {http://vo.resource.webservice.koolpoint.mocha.com/xsd}WebChildResource

这可怎么办啊?求助!!
...全文
113 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧