1
这是调用服务器中的函数执行某些任务的函数。但我必须传入一个ArrayList和一个String值。我无法将ArrayList传递到服务器。谁能告诉我我该怎么办?将自定义对象的ArrayList传递给kSOAP函数
public void findLocation(ArrayList<APData> apdatalist, String profilename){
SoapObject request = new SoapObject(NAMESPACE, "FindLocation");
PropertyInfo quotesProperty = new PropertyInfo();
quotesProperty.setName("profileName");
quotesProperty.setValue(profilename);
quotesProperty.setType(String.class);
request.addProperty(quotesProperty);
request.addProperty("AP_List", APData.class);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpRequest = new HttpTransportSE(URL);
httpRequest.debug = true;
String result = "";
try
{
httpRequest.call(SOAP_ACTION, envelope);
Log.e("Request",httpRequest.requestDump.toString());
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
Log.e("Response",httpRequest.responseDump.toString());
result = response.toString();
if(result == null){
Log.e("AndroidRuntime", "No location result is return!");
}
}
catch(Exception e)
{
e.printStackTrace();
}
//return temp;
}
工作,你有没有找到一个答案?我也有完全一样的问题。 – Bashorings
对不起...还没有找到解决方案。 – user918197