1. Create the WebService client through Eclipse, which is a feature that eclipse comes with, not in detail;
2, through the command according to the WSDL file to generate WebService client, the following code, the command is written as a batch file execution can:
Set Home=d:\workspace\cvte\ekp\webcontent\web-inf\lib
Java-classpath%home%\axis-1.4.jar;%home%\axis-ant.jar;%home%\commons-discovery-0.2.jar;%home%\ commons-logging-1.0.4.jar;%home%\jaxrpc.jar;%home%\log4j-1.2.16.jar;%home%\mail.jar;%home%\saaj-api-1.3.jar;% Home%\wsdl4j-1.6.2.jar;; %home%\mail.jar; Org.apache.axis.wsdl.wsdl2java-p com.landray.kmss.cvte.review.integration.webservice.client.ocs-t-S/http ocs.gz.cvte.cn/ws/swdeliverbill?wsdl
Pause
Note the existence of each jar package and the path of the jar package, as well as the package name of the client code.
3, directly write Java code calls, the following is the use of axis call WebService
Service service = new service ();//Create a service object
string endPoint = "http:// Ocstestlmk.gz.cvte.cn/ws/swdeliverbill ";//Do you want to remove the WSDL here, or you will get an error
//your WebService URL
QName QName = new QName (endPoint);//Create a QName object throw your endPoint in
call call = Service.createcall (QName, " Getsysoftbyworkorderid ");//Create a Call object throw QName strength into the websevice, and throw in the name of the method provided, I'm SayHello
Call.settargetendpointaddress (EndPoint); Specify endpoint in the call instance.
Object invoke = Call
. Invoke (New object[] {"Ki5lkjofj4fsj3ddsjj3sdji38j6",
"Liaomingkai", "qx-sy15031071h"});
System.out.print (Invoke);
List outputvalues = Call.getoutputvalues ();
for (Iterator Iterator = Outputvalues.iterator (); Iterator.hasnext ();) {
Object object = (object) iterator.next ();
System.out.println (object);
}
How the WebService client is generated