首页 > Web开发 > 详细

客户端动态调用cxf websevice 异常

时间:2014-03-30 14:58:47      阅读:697      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
三月 30, 2014 10:06:40 上午 org.apache.cxf.common.jaxb.JAXBUtils logGeneratedClassNames
信息: Created classes: com.test.server.HelloWorld, com.test.server.HelloWorldResponse, com.test.server.ObjectFactory
Exception in thread "main" org.apache.cxf.common.i18n.UncheckedException: No operation was found with the name {http://impl.server.test.com/}helloWorld.
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:342)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:336)
    at com.test.client.HelloWorl.main(HelloWorl.java:20)
Java Result: 1
bubuko.com,布布扣

解决方法:对服务端的接口实现类中的@WebService添加targetNamespace,其值为接口包名的倒置,

例如我的IHelloWorld接口所在的包为com.test.server,此时对应的targeNamespace的值为http://server.test.com/

例如:

bubuko.com,布布扣
@WebService(
        endpointInterface = "com.test.server.IHelloWorld", 
        serviceName="helloWorld", 
        targetNamespace="http://server.test.com/")
public class HelloWorldImp implements IHelloWorld {

    public String helloWorld(String name) {
        return name+" Hello,World!";
    }
    
}
bubuko.com,布布扣

客户端动态调用cxf websevice 异常,布布扣,bubuko.com

客户端动态调用cxf websevice 异常

原文:http://www.cnblogs.com/yshyee/p/3633537.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!