解决CXF的msdl2java生成的继承service类的构造函数报错问题

   这是三个报错的构造函数:


//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
    //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
    //compliant code instead.
    public IcpBusinessService(WebServiceFeature ... features) {
        super(WSDL_LOCATION, SERVICE, features);
    }

    //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
    //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
    //compliant code instead.
    public IcpBusinessService(URL wsdlLocation, WebServiceFeature ... features) {
        super(wsdlLocation, SERVICE, features);
    }

    //This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
    //API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
    //compliant code instead.
    public IcpBusinessService(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
        super(wsdlLocation, serviceName, features);
    }

 原因请参考:http://cxf.apache.org/docs/23-migration-guide.html   官方说明。

 其不能正常编译通过是由于jax-ws2.2规约与java6冲突。 但程序又不能仅以java5来编译,故需要降低jax-ws规约版本,
可以这样处理:  执行命令

wsdl2java -frontend jaxws21 http://192.168.18.24/web_service?wsdl


你可能感兴趣的:(Java基础)