JAX-WS generates two commands for server and client

Source: Internet
Author: User
Tags wsdl
generating a WSDL directory on the server

First, go to the DOS command window and navigate to the project root directory, such as:

C:\Users\wanzheny\workspace\baidumap

To execute the command line:

WSGEN-CP C:\Users\wanzheny\workspace\baidumap\WebContent\WEB-INF\classes com.ws.impl.hello-wsdl-s src-r wsdl

Explain:

-CP is followed by the project's classes path and the classpath of the class to generate WS, if that directory is not found, refer to my previous article.

No automatic compilation under Eclipse, or no files in the Web-inf/classes directory, the solution to the failed compilation

-S: Follow the source folder, which is the path to the origin file.

-d Specifies the location of the generated class file.

-r Specifies the location of the generated resources file. such as the location of the WSDL, XSD. The path needs to be created manually.

-wsdl-servicename,-portname three parameters specify the name of the service and port in the generated WSDL file. Note: The SEI here is a endpoint implementation class, not an interface. Must first write a endpoint implementation class, the class with @webservice declaration good webservice, and then compile it into a class file, can be provided for wsgen use.

Importing server-side helper code on the client

Usage:wsimport [Options] <WSDL_URI> main options:

Also first to the DOS command, locate the client in the same path, such as:

C:\Users\wanzheny\ws3\client

Execute command:

Wsimport-keep http://localhost:8080/baidumap/HelloService?wsdl-d src

Explain:

-keep follows the access path of the WSDL.

-d Specifies the location of the generated class file, typically placed in the SRC directory.

-s Specifies the location of the generated Javasource file.

-wsdllocation Specifies the @webservice.wsdllocation and @WebServiceClient in the generated Java source. The value of the Wsdllocation

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.