java: Rpc/encoded wsdls are not supported in JAXWS 2.0

前端 未结 6 1877
南方客
南方客 2020-11-28 03:31

I\'m using CXF 2.1 to generate java code from a wsdl, but I\'m getting the following error:

WSDLToJava Error: Rpc/encoded wsdls are not supported in JAXWS 2.         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 03:58

    RPC/encoded is a vestige from before SOAP objects were defined with XML Schema. It's not widely supported anymore. You will need to generate the stubs using Apache Axis 1.0, which is from the same era.

    java org.apache.axis.wsdl.WSDL2Java http://someurl?WSDL 
    

    You will need the following jars or equivalents in the -cp classpath param:

    • axis-1.4.jar
    • commons-logging-1.1.ja
    • commons-discovery-0.2.jar
    • jaxrpc-1.1.jar
    • saaj-1.1.jar
    • wsdl4j-1.4.jar
    • activation-1.1.jar
    • mail-1.4.jar

    This will generate similar stubs to wsimport.

    Alternatively, if you are not using the parts of the schema that require rpc/encoded, you can download a copy of the WSDL and comment out those bits. Then run wsimport against the local file.

    If you look at the WSDL, the following bits are using rpc/encoded:

    
    

提交回复
热议问题