客戶端的調(diào)用方法
/* **************** 調(diào)用方法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 " }); //因?yàn)榉祷刂凳荢tring類型,所以這里調(diào)用的返回值也是String類型
System.out.println(">>> " + k); //返回值輸出