1. 在使用wsdl2java命令生成client文件时在Service的Java文件中面出现super构造错误,这是因为jax-ws2.2规约与java6冲突  故须要减少jax-ws规约版本号。

解决方法:wsdl2java -frontend jaxws21  http://localhost:8080/MyWebService?

WSDL    生成client文件



   2.  在使用wsdl2java生成的client文件  。假设我们改动了包的名称就会出现

      Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException

at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:347)

at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336)

at javax.xml.ws.Service.getPort(Service.java:92)

at test3.MyWebService.getWebServiceTestImplPort(MyWebService.java:58)

at test3.Test.main(Test.java:12)

Caused by: org.apache.cxf.service.factory.ServiceConstructionException

at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:341)

at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)

at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:446)

at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:548)

at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)

at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)

at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)

at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)

at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157)

at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)

at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:478)

at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:345)

... 4 more

Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions

Two classes have the same XML type name "{http://test2/}sayGoodby". Use @XmlType.name and @XmlType.namespace to assign different names to them.

this problem is related to the following location:

at test3.jaxws_asm.SayGoodby

this problem is related to the following location:

at test3.SayGoodby

at public javax.xml.bind.JAXBElement test3.ObjectFactory.createSayGoodby(test3.SayGoodby)

at test3.ObjectFactory

Two classes have the same XML type name "{http://test2/}sayGoodbyResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.

this problem is related to the following location:

at test3.jaxws_asm.SayGoodbyResponse

this problem is related to the following location:

at test3.SayGoodbyResponse

at public javax.xml.bind.JAXBElement test3.ObjectFactory.createSayGoodbyResponse(test3.SayGoodbyResponse)

at test3.ObjectFactory

Two classes have the same XML type name "{http://test2/}sayHiResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.

this problem is related to the following location:

at test3.jaxws_asm.SayHiResponse

this problem is related to the following location:

at test3.SayHiResponse

at public test3.SayHiResponse test3.ObjectFactory.createSayHiResponse()

at test3.ObjectFactory

Two classes have the same XML type name "{http://test2/}sayHi". Use @XmlType.name and @XmlType.namespace to assign different names to them.

this problem is related to the following location:

at test3.jaxws_asm.SayHi

this problem is related to the following location:

at test3.SayHi

at public test3.SayHi test3.ObjectFactory.createSayHi()

at test3.ObjectFactory

   因此,在使用wsdl2java生成client文件时。不要改动目录的名称。





     

CXF生成client注意事项的更多相关文章

  1. 关于cxf生成客户端代码中的JAXBElement<String>

    1.使用自动生成的java文件中的 ObjectFactory构造入参 关于cxf生成客户端代码中的JAXBElement<String>    在使用cxf或者x-fire进行webse ...

  2. (转)wsdl文件用SoapUI快速创建WebService,CXF生成客户端代码

    原文地址:http://blog.csdn.net/fjekin/article/details/62234861 一.前言 最近项目接触到2C的很多接口,提供接口文档和WSDL文件,一开始测试接口都 ...

  3. WebService -- Java 实现之 CXF ( 使用CXF工具生成client 程序)

    1. 下载CXF 工具解压到磁盘 2.添加工具bin目录到PATH环境变量 3.创建一个CXF client新项目 4. run -> cmd 到指定目录,并运行工具目录下的批处理 “wadl2 ...

  4. 通过wsdl生成client 的几种方式

    wsimport 位置 %JAVA_HOME%/bin/wsimport.exe 帮助 wsimport -help Usage: wsimport [options] <WSDL_URI> ...

  5. 用cxf生成webservice的java客户端代码

    百度来的: 最近,由于要用到某公司提供的webservice实现的api接口,想到了用cxf的wsdl2java工具来生成客户端程序.(自己写是比较麻烦且费时,so偷懒一下..) 使用步骤如下: 一. ...

  6. 利用CXF生成webservice客户端代码

    一.CXF环境的配置 1.下载CXF的zip包. 2.解压.例如:D:\ITSoft\webserviceClientUtils\cxf\apache-cxf-2.7.17 3.配置环境变量:新建变量 ...

  7. CXF生成调用webservice的客户端

    首先当前是从官网下载cxf组件. http://cxf.apache.org/download.html 下载后解压,在这里主要是用到解压后的bin目录中的wsdl2java.bat该批处理文件. 可 ...

  8. 根据werservice代码用CXF生成WSDL

    原文:http://hongyegu.iteye.com/blog/619147,谢谢! import org.apache.cxf.tools.java2ws.JavaToWS; import ne ...

  9. WCF 无法生成 client

    在MVC中调用WCF 总是没有client 后来在网上查找原因,去掉Reuse type in referrenced assenbiles ,就可以生成代理代码.

随机推荐

  1. Java虚拟机对锁优化所做的努力(读书笔记)

    锁偏向      是一种加锁操作的优化手段,他的核心思想是:如果一个线程获得了锁,那么就进入偏向模式,当这个线程再次请求锁时,无须在做任何同步操作,因此在几乎没有锁竞争的场合,偏向锁是比较好的优化效果 ...

  2. php装饰器

    <?php /* * 用一个类来装饰另一个类,动态的给一个对象增加一些额外功能,这些功能一般是在这个对象调用方法前或方法后 * 比如我们要给User类增加一个登陆日志的功能 */ // 抽象构件 ...

  3. select、poll、epoll之间的区别总结[整理](转)

    select,poll,epoll都是IO多路复用的机制.I/O多路复用就通过一种机制,可以监视多个描述符,一旦某个描述符就绪(一般是读就绪或者写就绪),能够通知程序进行相应的读写操作.但select ...

  4. Elasticsearch 2014年10月简报

    1. Elasticsearch Updates 1.1 公布了Kibana 4 Beta 1 和Beta 1.1 Kibana 4不管是在界面的布局,使用配置方法,还是底层绘制图表的方式都与Kiba ...

  5. asp.net中UpdatePanel数据加载成功后回调

    //添加UpdatePanel加载成功后执行的js方法 Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(onPageLoade ...

  6. 解决zabbix“ZBX_NOTSUPPORTED: Timeout while executing a shell script”报错

    如题所示,在zabbix_server使用zabbix_get获取自定义“UserParameter”对应的脚本的数据时,出现了如题所示的报错信息 [root@nmp01 scripts]# /usr ...

  7. 使用PostMan快速生成代码

    Postman是一款功能强大的网页调试与发送网页HTTP请求的Chrome插件.关于PostMan的下载和使用网上有很多相关的博客介绍,本文主要介绍PostMan在进行模拟Http请求后可以根据需要的 ...

  8. 转MQTT--mosquitto服务器系统内容主题

    MQTT客户端可以通过订阅位于$SYS层次下的主题来查看mosquitto服务器的状态信息.标记为Static的主题对于每一次订阅只发布一次.其它所有主题每隔sys_interval(在mosquit ...

  9. poj3411--Paid Roads(bfs+状压)

    题目链接:id=3411">点击打开链接 题目大意:有n个点.m条有向边,经过边须要一个花费,a b c p q代表 a到b的一条道路,假设经过这条边之前经过c点,那么须要p的花费,否 ...

  10. Linux下性能分析工具汇总

    来自:http://os.51cto.com/art/201104/253114.htm 本文讲述的是:CPU性能分析工具.Memory性能分析工具.I/O性能分析工具.Network性能分析工具. ...