用wsdl生成客戶端
Wsdl2java –uri http://localhost:8080/axis2/services/SimpleServer?wsdl –o d:" -d jaxbri
將生成的java文件拷貝到工程的src文件夾下
public class WsTest {
/**
* @param args
* @throws RemoteException
*/
public static void main(String[] args) throws RemoteException {
// TODO Auto-generated method stub
SimpleServerStub ssstub = new SimpleServerStub();
SimpleMethod sm = new SimpleMethod();
sm.setName("xujun");
SimpleMethodResponse response = ssstub.simpleMethod(sm);
String result = response.get_return();
System.out.println(result);
}
}
/**
* @param args
* @throws RemoteException
*/
public static void main(String[] args) throws RemoteException {
// TODO Auto-generated method stub
SimpleServerStub ssstub = new SimpleServerStub();
SimpleMethod sm = new SimpleMethod();
sm.setName("xujun");
SimpleMethodResponse response = ssstub.simpleMethod(sm);
String result = response.get_return();
System.out.println(result);
}
}