首页 技术 正文
技术 2022年11月21日
0 收藏 785 点赞 4,614 浏览 3415 个字

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文件时。不要改动目录的名称。

     

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,487
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,736
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,486
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,126
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,287