客户端的调用方法
/* **************** 调用方法2 *********************** */
String method = "sayHello";//
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(
"http://127.0.0.1:8083/xxx/HelloService"));
call.setOperationName(new QName("http://test/HelloService", method));
call.setUseSOAPAction(true);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setSOAPActionURI("http://test/HelloService");
call.addParameter("pwd", org.apache.axis.Constants.XSD_STRING,
ParameterMode.IN);
String k = (String) call.invoke(new Object[] { "chenbo dddd " }); //因为返回值是String类型,所以这里调用的返回值也是String类型
System.out.println(">>> " + k); //返回值输出
posted on 2008-09-11 16:46
波 阅读(166)
评论(0) 编辑 收藏