import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class AxisClient {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Person person = new Person("Stephine","Yu");
String endpoint = "http://localhost:8082/services/personService";
String operation = "printPerson";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName(operation);
// 这里的person 就是方法的参数。有几个参数,这里就写几个
Person ps = (Person) call.invoke(new Object[] { person });
System.out.println(ps.getName());
} catch (Exception e) {
e.printStackTrace();
}
}
}