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

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);

不管是那种方式都不要忘记地址最后面的一个斜杠


猜你喜欢

转载自blog.csdn.net/lichuangcsdn/article/details/77923428