给你例子,参考以下
try{
String endpoint= "http://localhost:8080/axis/services/helloservice";
Service service = new Service();
Call call = (Call) service.createCall();
call.setOperationName(new QName(endpoint,"sayHello"));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
String ret = (String) call.invoke(new Object[] {"zhangsanaaa"});
System.out.println("return value is : " + ret);
}
catch (Exception ex){
ex.printStackTrace();
}
try{
String endpoint= "http://localhost:8080/axis/services/helloservice";
Service service = new Service();
Call call = (Call) service.createCall();
call.setOperationName(new QName(endpoint,"sayHello"));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
String ret = (String) call.invoke(new Object[] {"zhangsanaaa"});
System.out.println("return value is : " + ret);
}
catch (Exception ex){
ex.printStackTrace();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货