Recently, the CXF Wsdl2java tool was used to generate client programs because of the API interfaces that a company provides for WebService implementations. (Write yourself is more troublesome and time-consuming, so lazy,,)
Use the following steps:
First, download the Apache CXF package, such as Apache-cxf-2.7.10.zip, address: cxf.apache.org/download.html
Second, decompression apache-cxf-2.7.10.zip to a directory, such as D:\apache-cxf-2.7.10
Third, set environment variables
1, cxf_home=d:\apache-cxf-2.7.10
2, after the path plus%cxf_home%/bin; (not classpath)
Enter Wsdl2java in the CMD command, indicating that the configuration was successful if prompted usage
Iv. Running Wsdl2java Tools
In the cmd command, enter: wsdl2java-d d:\\src-client http://api.xxx.cn/xxxAPI/service/auditResBatchQueryService?wsdl
(D:\\src is the directory where the client program code resides, HTTP://API.XXX.CN/XXXAPI/SERVICE/AUDITRESBATCHQUERYSERVICE?WSDL is the address that defines WebService)
Attached Wsdl2java usage:
Wsdl2java-p com-d D:\\src-all xx.wsdl
-p Specifies the namespace of its WSDL, which is the package name to generate code for:
-d Specifies the directory where the code is to be generated
-client code to generate client test Web service
-server the code for the build server to start the Web service
-impl to generate Web service implementation code
-ant Generate Build.xml files
-all generates all start endpoint codes: Types,service Proxy,,service interface, server mainline, client mainline, implementation object, and an T build.xml file.