This code was generated to turn a result from a webservice into a variable called listHandle and another Called listLength
1st activity
if ("getUsersCombo".equals(whatMethod))
{
this.data = Data;
}
I need to turn "Data" - which is an object data type into listLength and listHandle, how do I use the below code to do this?
2nd activity
package com.Wsdl2Code.WebServices.USD_WebService;
//------------------------------------------------------------------------------
// <wsdl2code-generated>
// This code was generated by http://www.wsdl2code.com version 2.5
//
// Date Of Creation: 8/20/2014 1:23:43 AM
// Please dont change this code, regeneration will override your changes
//</wsdl2code-generated>
//
//------------------------------------------------------------------------------
//
//This source code was auto-generated by Wsdl2Code Version
//
import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;
import java.util.Hashtable;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
public class ListResult implements KvmSerializable {
public int listHandle;
public int listLength;
public ListResult(){}
public ListResult(SoapObject soapObject)
{
if (soapObject == null)
return;
if (soapObject.hasProperty("listHandle"))
{
Object obj = soapObject.getProperty("listHandle");
if (obj != null && obj.getClass().equals(SoapPrimitive.class)){
SoapPrimitive j =(SoapPrimitive) obj;
listHandle = Integer.parseInt(j.toString());
}else if (obj!= null && obj instanceof Number){
listHandle = (Integer) obj;
}
}
if (soapObject.hasProperty("listLength"))
{
Object obj = soapObject.getProperty("listLength");
if (obj != null && obj.getClass().equals(SoapPrimitive.class)){
SoapPrimitive j =(SoapPrimitive) obj;
listLength = Integer.parseInt(j.toString());
}else if (obj!= null && obj instanceof Number){
listLength = (Integer) obj;
}
}
}
@Override
public Object getProperty(int arg0) {
switch(arg0){
case 0:
return listHandle;
case 1:
return listLength;
}
return null;
}
@Override
public int getPropertyCount() {
return 2;
}
@Override
public void getPropertyInfo(int index, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo info) {
switch(index){
case 0:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "listHandle";
break;
case 1:
info.type = PropertyInfo.INTEGER_CLASS;
info.name = "listLength";
break;
}
}
@Override
public void setProperty(int arg0, Object arg1) {
}
}
0 comments:
Post a Comment