package com.axis;
import java.rmi.RemoteException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
publicclass ClientAxis {
publicstaticvoid main(String []args){
try {
String url = "http://127.0.0.1:9090/Webservice/services/ServerAxisWSDD";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(new QName(url,"remoteMethod"));
String result = (String) call.invoke(new Object[]{"Hello AXIS!"});
System.out.println(result);
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RemoteException e) {
// TODO: handle exception
}
}
}
|