打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
CXF动态客户端No operation was found with the name问题
猎头职位:上海: Junior Product Manager
相关文章:CXF WebService视频教程,自己录的(更新第7集 异步调用 2009.1.15)。
如何让CXF导出重载的方法
Apache CXF 在 WebLogic 9.2 上的问题定位分析及权宜之计
推荐群组:Pipboy
更多相关推荐
如果WebService发布时,接口和实现类指定的namespace不同。
那么使用CXF动态客户端调用时,会抛出No operation was found with the name的异常。
Java代码
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = factory.createClient(wsdl);
Object[] res = client.invoke(operation, realParams);
用下面的方法临时处理一下吧:
Java代码
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = factory.createClient(wsdl);
// 下面一段处理 WebService接口和实现类namespace不同的情况
// CXF动态客户端在处理此问题时,会报No operation was found with the name的异常
Endpoint endpoint = client.getEndpoint();
QName opName = new QName(endpoint.getService().getName().getNamespaceURI(), operation);
BindingInfo bindingInfo = endpoint.getEndpointInfo().getBinding();
if (bindingInfo.getOperation(opName) == null) {
for (BindingOperationInfo operationInfo : bindingInfo.getOperations()) {
if (operation.equals(operationInfo.getName().getLocalPart())) {
opName = operationInfo.getName();
break;
}
}
}
Object[] res = client.invoke(opName, realParams);
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
开发CXF JAVA客户端
cxf 调用webservice的方式
cxf设置代理访问webservice接口
WCF: Working with One-Way Calls, Callbacks, And Events
CXF的三种发布方式和客户端调用方法
cxf
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服