当前位置:首页 > 开发 > 系统架构 > 架构 > 正文

CXF关于wsdl2java 生成 service class 构造器报错的解决办法

发表于: 2011-03-29   作者:xc_wangwang   来源:转载   浏览次数:
摘要: I'm marking this as "not a problem" as the generated code is correct per spec. CXF 2.3.2 is a JAX-WS 2.2 compliant implementation and thus must generate code compliant to the JAX-WS 2.2 spec

I'm marking this as "not a problem" as the generated code is correct per spec. CXF 2.3.2 is a JAX-WS 2.2 compliant implementation and thus must generate code compliant to the JAX-WS 2.2 specification which requires those constructors like that. HOWEVER, to compile them on Java 6, you will likely need to endorse the 2.2 jaxws-api jar (and likely the jaxb-api jar as well). See the 2.3 migration guide: http://cxf.apache.org/docs/23-migration-guide.html for some details about the endorsed stuff.

The alternative workaround, right now, is to delete the api jars from lib/endorsed. In that case, wsdl2java will detect that the 2.2 versions are not available/endorsed and will switch to generating 2.1 compliant code.

I also just added a new frontend (will be there for 2.3.3) to force 2.1 behavior. With 2.3.3, you'll be able to do "wsdl2java -frontend jaxws21" to tell it to use the JAX-WS 2.1 compliant frontend instead.

 

 

解决办法:

 

Alternative workaround you recommended works great!

"wsdl2java -frontend jaxws21" sounds better to me. I think it will be an important new feature to CXF as not many organisations may have moved past Java6 and would like to have jaxws_2.1

CXF关于wsdl2java 生成 service class 构造器报错的解决办法

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
之前发布了一个绘制等值面的服务,在本机测试的时候始终都可以访问,没有任何的问题,但是在远程访
这次开发web service对接,用的是cxf2.0.13 本来只用了cxf的框架,没有使用cxf提供的工具,比如wsdl2
最近,由于要用到某公司提供的webservice实现的api接口,想到了用cxf的wsdl2java工具来生成客户端程
第一步、在“解决方案JavaGenerate”中添加类库,用于存放Service的模版及相应文件,我们命名这个类
java 阵营中的Apache-cxf和C#的wcf目前是市场上webservice产品的主流框架。 Web Service技术简单的
1、配置环境变量 下载最新版本的 apache-cxf-3.0.2 压缩包,解压到当前环境。如作者解压到"F:\迅雷
abap 构造方法是由运行时环境自动调用的,一般用于初始化操作,不能在程序中由程序调用,系统通常会
1、需要 一个包:apache-cxf-2.6.1.gz 这个包里有好多jar包,一定要下载下来。 将此包解压,我是放
1.Class类---Class类是反射的基石,Class类的实例表示正在运行的java应用程序中的接口或类。换句话
客户端 public class Client { private Client(){} public static void main(String[] args) { Appl
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号