The simple use of Apache CXF Wsdl2java Tools

Source: Internet
Author: User
Tags wsdl

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.