zoukankan      html  css  js  c++  java
  • 客户端动态调用cxf websevice 异常

    三月 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

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

    例如我的IHelloWorld接口所在的包为com.test.server,此时对应的targeNamespace的值为http://server.test.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!";
        }
        
    }
  • 相关阅读:
    aliyun搭博客从零到一
    centos8飞行驾驶舱和docker安装
    squid的三种模式
    Linux和windos路由
    ca认证(https)
    shell脚本1
    heartbeat双主高可用
    Linux字符界面字符颜色显示
    不同尺寸的图片垂直水平居中的三种形式
    两栏三栏自适应布局
  • 原文地址:https://www.cnblogs.com/yshyee/p/3633537.html
Copyright © 2011-2022 走看看