您的位置:首页 > 理论基础 > 计算机网络

cxf调用WebService时出现No operation was found with the name {http://impl.server.test.com/}helloWorld

2017-09-10 17:33 1086 查看
cxf调用WebService时出现No operation was found with the name {http://impl.server.test.com/}helloWorld错误。

下面提供2中解决方法

一种是在服务端指定命名空间,即在服务端接口的实现类添加targetNamespace = “http://server.test.com/”;注意这里是接口的倒序,而不是实现类的倒序

另外一种方法是在客户端指定命名空间(我这里用的是JaxWsDynamicClientFactory方式)

QName opName = new QName("http://server.test.com/", "checkValueRange");

Object[] result = client.invoke("opName , 1,2);

不管是那种方式都不要忘记地址最后面的一个斜杠
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐