Skip to content

Instantly share code, notes, and snippets.

@The-LoneWolf
Created May 9, 2018 14:26
Show Gist options
  • Save The-LoneWolf/894bbc336641e228fb5a2c29c3ec9377 to your computer and use it in GitHub Desktop.
Save The-LoneWolf/894bbc336641e228fb5a2c29c3ec9377 to your computer and use it in GitHub Desktop.
public String multipleRequest() {
String resultString = null;
String SOAP_ACTION = "http://tempuri.org/Ins_DriverLocationlist";
String METHOD_NAME = "Ins_DriverLocationlist";
String NAMESPACE = "http://tempuri.org/";
String URL = NetUtil.url + "GoSafe.asmx";
try {
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapObject Objects = new SoapObject(NAMESPACE, "Objects");
for (int i = 0; i < locationObjList.size(); i++) {
SoapObject location_received = new SoapObject(NAMESPACE, "LocationRecieved");
location_received.addProperty("MobileNo", locationObjList.get(i).phone);
location_received.addProperty("Imei", locationObjList.get(i).Imei);
location_received.addProperty("RoutId", locationObjList.get(i).RoutId);
location_received.addProperty("Speed", locationObjList.get(i).Speed);
location_received.addProperty("time", locationObjList.get(i).time);
location_received.addProperty("PersianDate", locationObjList.get(i).PersianDate);
location_received.addProperty("Dtime", locationObjList.get(i).Dtime);
location_received.addProperty("GoBack", locationObjList.get(i).GoBack);
location_received.addProperty("lots", locationObjList.get(i).Lot);
location_received.addProperty("Lans", locationObjList.get(i).Lan);
Objects.addProperty("LocationRecieved", location_received);
}
Request.addProperty("Objects", Objects);
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(Request);
Log.d("recievedx", Request.toString());
HttpTransportSE transport = new HttpTransportSE(URL);
transport.call(SOAP_ACTION, soapEnvelope);
resultString = soapEnvelope.getResponse().toString();
Log.i(LOGSERVICE, "Result: " + resultString);
} catch (Exception ex) {
Log.e(LOGSERVICE, "Errorx: " + ex.getMessage());
}
return resultString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment