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

前端 未结 6 1878
南方客
南方客 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:48

    I used Axis 1.4 as Chase Seibert suggested in his answer, although the download link given in that answer doesn't work. The alternative download link I used gave me different libraries. Below are the steps I followed to generate my code.

    Go to http://apache.is.co.za/axis/axis/java/1.4/ and download axis-bin-1_4.zip.

    Extract it, and you should have the following files (among others):

    • axis.jar
    • commons-discovery-0.2.jar
    • commons-logging-1.0.4.jar
    • jaxrpc.jar
    • saaj.jar
    • wsdl4j-1.5.1.jar

    Execute WSDL2Java using the following command (replacing the URL, of course):

    java -cp axis.jar;commons-logging-1.0.4.jar;commons-discovery-0.2.jar;jaxrpc.jar;saaj.jar;wsdl4j-1.5.1.jar org.apache.axis.wsdl.WSDL2Java http://someURL?WSDL
    

    This will generate your Java files.

    P.S.: This seems to work equally well using Axis 1.2.1.

提交回复
热议问题