码迷,mamicode.com
首页 > 其他好文 > 详细

CXF生成client注意事项

时间:2017-04-25 13:24:22      阅读:435      评论:0      收藏:0      [点我收藏+]

标签:ted   sdl   initial   tab   create   cts   abi   except   jax-ws   

    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注意事项

标签:ted   sdl   initial   tab   create   cts   abi   except   jax-ws   

原文地址:http://www.cnblogs.com/jzssuanfa/p/6761324.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!