WebService Client Generation method

Source: Internet
Author: User
Tags wsdl

1. Using JDK Wsimport.exe to generate client code

Open the cmd Command box and enter the following format command:

Format: wsimport-s "src directory"-P "generate class with package name"-keep "WSDL publishing Address"
Example: Wsimport-s g:\\workspace\\webservice\\theclient\\src-p com.hyan.client-keep http://localhost:9001/Service/ servicehello?wsdl

Attention:

1) "src directory" address cannot contain spaces
2) "WSDL publishing address" Don't miss "? wsdl"

You can also switch the current directory to the SRC directory, and then omit the-s setting


2. Automatically generate client code using MyEclipse

To create a new Java project, select the Web service client (under MyEclipse), as shown below:

Next step

Here you select the project where the WebService client code resides

There are two ways to import WSDL, generally choose the WSDL URL, directly enter the link address on it, but if there is a problem with the online WSDL file, need to modify and then use, this time needs to be saved to the local, after the modification is completed, select the WSDL File;java Package selects the packages in which the code is located, and next verifies that no problem is available after finish.


Other methods of production can be consulted: http://blog.csdn.net/gaogaoshan/article/details/8980775

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.