Package com.segsec.gisap.webservice;
Import Java.util.Vector;
Import Javax.xml.namespace.QName;
Import Org.apache.axis.client.Call;
Import Org.apache.axis.client.Service;
Import Org.apache.axis.encoding.XMLType; public class Lbsrescue {private String url = "Http://IP address/lbsrescue.asmx";//provide interface address private string soapaction = "http ://www.***.net:7005/";
Domain name, which is the public lbsrescue () defined in server () {String city = "Beijing";
Service service = new service ();
try {Call call = (call) Service.createcall ();
Call.settargetendpointaddress (New Java.net.URL (URL));
Call.getmessagecontext (). Setusername ("YGBX");//user name in axis.
Call.getmessagecontext (). SetPassword ("5ky3xhfxynnhptwrhvdycq==");//Password Call.setusesoapaction (true);
Call.setsoapactionuri (SOAPAction + "sendlist"); Call.setoperationname (New QName (SOAPAction, "sendlist")); Set which method to invoke Call.addparameter (new QName (SOAPAction, "CompanyID"),//Set parameters to pass Org.apache.axis.encoding.XMLT Ype. Xsd_string, JAVAX.XMl.rpc.parametermode.in);
Call.addparameter (New QName (SOAPAction, "companypwd"),//Set parameters to pass Org.apache.axis.encoding.XMLType.XSD_STRING,
Javax.xml.rpc.ParameterMode.IN);
Call.addparameter (New QName (SOAPAction, "mobile"),//Set parameters to pass Org.apache.axis.encoding.XMLType.XSD_STRING,
Javax.xml.rpc.ParameterMode.IN);
Call.addparameter (New QName (SOAPAction, "flag"),//Set parameters to pass Org.apache.axis.encoding.XMLType.XSD_STRING,
Javax.xml.rpc.ParameterMode.IN); Call.setreturntype (xmltype.xsd_string); The data type to return (custom type)//Call.setreturntype (Org.apache.axis.encoding.XMLType.XSD_STRING);//(standard type) call.setusesoapact
Ion (TRUE);
Call.setsoapactionuri (SOAPAction + "sendlist"); string s = (string) call.invoke (new object[] {"YGBX", "pfao/msenzv8lchxtpa9yw==", "15910510352", 1});//calling method and passing parameter System.
OUT.PRINTLN ("Registered mobile phone:" +s);
catch (Exception ex) {ex.printstacktrace (); } public static void Main (String args[]) {LbsrescuE LR = new Lbsrescue ();
}
}