import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class Test {
public static void main(String[] args) {
//testAddCustomer();
//testValidateLogin();
testGetMessageInfo();
}
public static void testAddCustomer(){
try {
String endpoint = "http://localhost:8080/ehomeSer/services/WebServiceCenter?wsdl";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(endpoint);
call.setOperationName(new QName("http://webservice.ehome.qinan.com","addCustomer"));
call.addParameter("name", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("key_code", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("idcard", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("pwd", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("tel", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.addParameter("address", org.apache.axis.encoding.XMLType.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://localhost:8080/ehomeSer");
String result = (String)call.invoke(new Object[]{"张三","KEY123","46368119900125794X","123456","0731-1231321","长沙市"});
System.out.println("addCustomer result is "+result);
}
catch (Exception e) {
System.err.println(e.toString());
}
}
}