import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
/*web服务方法签名:public String callService(String startTime, String endTime) */
public class ServiceTest {
public static void main(String[] args) {
String startTime = "2010-05-02";
String endTime = "2010-05-20";
String serviceSpace="http://service.xcky.com";
String methodName = "callService";//服务方法名
String serviceUrl= "http://localhost:8081/axis2/services/xcky?wsdl";
Service service = new Service();
Call call = null;
try {
call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(serviceUrl));
call.setOperationName(new QName(serviceSpace, methodName1));
Object[] inargs = new Object[] {startTime,endTime};//参数数组
String strReturn = (String)call.invoke(inargs);
System.out.println(strReturn);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}