Premise:
The ① already provides a WSDL interface
② the interface can be called normally
Step 1: generate a local class using the cxf wsdl2java Tool
Download CXF: http://cxf.apache.org/download.html
To configure environment variables:
cxf_home=e:\webservice\cxf\apache-cxf-2.1.1\apache-cxf-2.1.1
add ";%cxf_home%\bin" after PATH
Verify: The cmd command line is entered Wsdl2java, and if it shows its usage, the configuration is OK.
Run command: wsdl2java http://localhost:8080/XXX.wsdl ( Path to WSDL)
Class that will be generated for use at the current path of the Run command after running
Step 2: Import the generated Java class file into our project to see its structure.
In general, the service is called Xxxservice, this is our most concerned about the interface file
Step 3: View The document structure of the service
Red Box Two methods one is to instantiate the service method, one is to invoke the specific interface method
Step 4: Write the tool class to test the interface invocation situation
Java calls the WSDL interface