Generate WebService client code with the JDK's own tools

Source: Internet
Author: User

Recently through the "plunge into the WebService CXF video tutorial" Video Learning WebService, server-side code is no problem, but in the configuration of client code, but encountered a variety of problems.

First of all, it is recommended to use CXF's Wsdl2java tool in the video to generate the client code, which can never be run on my machine and cannot be solved.

Use the tool that comes with eclipse to generate code successfully, Anxi.

But learn to custom interceptor This section of the time, Configuration clientproxy.getclient () Here always error, has been unable to pass, white search not its solution ...

Finally, you can generate the client code with the Wsimport tool that comes with the JDK, try it out, and record the command here for future use.

Switch to the bin directory of the JDK and execute the following command:

wsimport-keep-d D:\WebService http://192.168.31.7/helloWorld?wsdl

Wait a moment. A bunch of Java code and Class code are generated in the D:\WebService directory, and the Java code is copied to its desired directory for normal use.

Generate WebService client code with the JDK's own tools

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.