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