import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
public class ListService {
private
static String METHOD_NAME = "GetList";
private
static String URL =Server.server + "/ServicesListService.asmx";
private
List<ListBean> Bens;
public ListService()
{
Bens = new
Vector<ListBean>();
}
private
List<ListBean> Beans;
@Override
public List<ListBean> GetBean(PassBean bean)
{ final String svalue =
"PassBean";
SoapObject
requestObject = new SoapObject(AppConst.NAMESPACE, METHOD_NAME);
requestObject.addProperty(svalue,
bean);
final
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet
= true;
envelope.setOutputSoapObject(requestObject);
envelope.addMapping(AppConst.NAMESPACE,
PassBean.
PassBean_CLASS.getSimpleName(),
UserGetPassBean.UserGetPassBean_CLASS);
final
Object response = new ServiceCaller().call(AppConst.SOAP_ACTION
+
METHOD_NAME, envelope, URL);
if
(response != null) {
try {
if
(response != null) {
SoapObject
classSoap = (SoapObject) response;
int
size = classSoap.getPropertyCount();
Beans = new
ArrayList<ListBean>();
for
(int i = 0; i < size; i++) {
ListBean Bean = new ListBean( (SoapObject) classSoap.getProperty(i));
Beans.add(Bean);
}
}
}
catch (Exception e) {
e.printStackTrace();
}
}
return
AnswerSheetBeans;
}
}
No comments:
Post a Comment