WSDL automatically generates web Service Java client

Source: Internet
Author: User
Tags wsdl

Reference: A Web service is required to make data import and export between systems recently, so a Java client needs to be generated from WSDL to read the data.

method One: Build the Java client using Xfire Eclipse plugin

1 Installing Xfire Eclipse plugin,update site:
Java code
    1. http: //dist.codehaus.org/xfire/update/   

2 new Java Project:wstest. We use a free web service to do the testing. This is the WSDL for the cell phone number attribution query.
Reference http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl
3 File->new->other, select the code generation from WSDL document under the Xfire folder to open the Codes Generation Wizard


4 Next, fill in the WSDL address above, the generated Java directory, the package name.


5 Right-click on the Wstest->properties->xfire and hook up all the Xfire Java packages.


6 Create a new class with the main function,
Java code
  1. Import  com.wilson.MobileCodeWSClient;
  2. Public class Main {
  3. Public static void main (string[] args) {
  4. Mobilecodewsclient client = new mobilecodewsclient ();
  5. System.out.println (Client.getmobilecodewssoap (). Getmobilecodeinfo ("15801902188", null  ));
  6. }
  7. }

WSDL automatically generates web Service Java client

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.