package com.service;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class test2 {
public static void main(String args[]){
String helloURL = "http://localhost:8889//services/HrmService";
try {
//以下都是套路
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress(helloURL);
call.setOperationName("checkUser");//WSDL里面描述的接口名称
call.addParameter("in0", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
call.addParameter("in1", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
call.addParameter("in2", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);//接口的参数
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_BOOLEAN);//设置返回类型
//给方法传递参数,并且调用方法
Object result = call.invoke(new String[]{"127.0.0.1","ywy","1"});
System.out.println((Boolean)result);
} catch (Exception e) {
e.printStackTrace();
}
}
}