首页 > 代码库 > No operation was found with the name {http://impl.service.xq.com/}sayHi

No operation was found with the name {http://impl.service.xq.com/}sayHi

org.apache.cxf.common.i18n.UncheckedException: No operation was found with the name {http://impl.service.xq.com/}sayHi.
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:347)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:341)
at com.xq.test.Test.main(Test.java:12)
Exception in thread "main" java.lang.NullPointerException
at com.xq.test.Test.main(Test.java:17)

将@webservice的targetNamespace改成"http://service.xq.com/",也就是发布的接口的包名,实在不知道就直接进入http://localhost:8080/cxftest/ws/helloService?wsdl,查看wsdl:definitions标签的xmlns:ns1="http://service.xq.com/",这也就是targetNamespace的值。

No operation was found with the name {http://impl.service.xq.com/}sayHi