Reference: A Web service is required to make data import and export between systems recently, so a Java client needs to be generated from WSDL to read the data.
method One: Build the Java client using Xfire Eclipse plugin
1 Installing Xfire Eclipse plugin,update site:
Java code
- http: //dist.codehaus.org/xfire/update/
2 new Java Project:wstest. We use a free web service to do the testing. This is the WSDL for the cell phone number attribution query.
Reference http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl
3 File->new->other, select the code generation from WSDL document under the Xfire folder to open the Codes Generation Wizard
4 Next, fill in the WSDL address above, the generated Java directory, the package name.
5 Right-click on the Wstest->properties->xfire and hook up all the Xfire Java packages.
6 Create a new class with the main function,
Java code
- Import com.wilson.MobileCodeWSClient;
- Public class Main {
- Public static void main (string[] args) {
- Mobilecodewsclient client = new mobilecodewsclient ();
- System.out.println (Client.getmobilecodewssoap (). Getmobilecodeinfo ("15801902188", null ));
- }
- }
WSDL automatically generates web Service Java client