本文整理汇总了Java中org.ksoap2.serialization.SoapObject.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java SoapObject.getProperty方法的具体用法?Java SoapObject.getProperty怎么用?Java SoapObject.getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ksoap2.serialization.SoapObject
的用法示例。
在下文中一共展示了SoapObject.getProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TotalsForUser
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public Totals[] TotalsForUser(String szAuthToken, FlightQuery fq, Context c) {
SoapObject Request = setMethod("TotalsForUserWithQuery");
Request.addProperty("szAuthToken", szAuthToken);
Request.addProperty("fq", fq == null ? new FlightQuery() : fq);
Totals[] rgt = new Totals[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving totals - " + getLastError());
else {
try {
rgt = new Totals[result.getPropertyCount()];
for (int i = 0; i < rgt.length; i++) {
rgt[i] = new Totals((SoapObject) result.getProperty(i));
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgt;
}
示例2: ReadResults
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private CustomPropertyType[] ReadResults(SoapObject result) {
CustomPropertyType[] rgcptCached = getCachedPropertyTypes();
CustomPropertyType[] rgcpt;
try {
rgcpt = new CustomPropertyType[result.getPropertyCount()];
for (int i = 0; i < rgcpt.length; i++)
rgcpt[i] = new CustomPropertyType(
(SoapObject) result.getProperty(i));
// if we made it here, we have successfully retrieved new values.
// ONLY NOW should we update the cache AND only if we got at least as many
// as we had originally. (Could be the same # but favorites could have changed)
if (rgcpt.length >= rgcptCached.length)
updateCache(rgcpt);
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
rgcpt = rgcptCached;
}
return rgcpt;
}
示例3: PropertiesForFlight
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public FlightProperty[] PropertiesForFlight(String szAuthToken, int idFlight, Context c) {
SoapObject Request = setMethod("PropertiesForFlight");
Request.addProperty("szAuthUserToken", szAuthToken);
Request.addProperty("idFlight", idFlight);
FlightProperty[] rgfp = new FlightProperty[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error getting properties for flight - " + getLastError());
else {
try {
rgfp = new FlightProperty[result.getPropertyCount()];
for (int i = 0; i < rgfp.length; i++)
rgfp[i] = new FlightProperty((SoapObject) result.getProperty(i));
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgfp;
}
示例4: CurrencyForUser
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public CurrencyStatusItem[] CurrencyForUser(String szAuthToken, Context c) {
SoapObject Request = setMethod("GetCurrencyForUser");
Request.addProperty("szAuthToken", szAuthToken);
CurrencyStatusItem[] rgCsi = new CurrencyStatusItem[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving currency - " + getLastError());
else {
try {
rgCsi = new CurrencyStatusItem[result.getPropertyCount()];
for (int i = 0; i < rgCsi.length; i++) {
rgCsi[i] = new CurrencyStatusItem((SoapObject) result.getProperty(i));
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgCsi;
}
示例5: ReadResults
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private Aircraft[] ReadResults(SoapObject result, Boolean fFallbackToCache) {
Aircraft[] rgAc = new Aircraft[0];
try {
rgAc = new Aircraft[result.getPropertyCount()];
for (int i = 0; i < rgAc.length; i++)
rgAc[i] = new Aircraft((SoapObject) result.getProperty(i));
// if we made it here, we have successfully retrieved new values.
// ONLY NOW should we update the cache
updateCache(rgAc);
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
if (fFallbackToCache)
rgAc = getCachedAircraft();
}
return rgAc;
}
示例6: GetMakesAndModels
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public MakesandModels[] GetMakesAndModels(Context c) {
setMethod("MakesAndModels"); // no need to save the request, since nothing goes out
MakesandModels[] rgMM = new MakesandModels[0];
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Error retrieving makes and models - " + getLastError());
else {
try {
rgMM = new MakesandModels[result.getPropertyCount()];
for (int i = 0; i < rgMM.length; i++) {
rgMM[i] = new MakesandModels((SoapObject) result.getProperty(i));
}
} catch (Exception e) {
setLastError(getLastError() + e.getMessage());
}
}
return rgMM;
}
示例7: FlightPathForFlight
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public LatLong[] FlightPathForFlight(String szAuthToken, int idFlight, Context c) {
LatLong[] rgll = new LatLong[0];
SoapObject Request = setMethod("FlightPathForFlight");
Request.addProperty("szAuthUserToken", szAuthToken);
Request.addProperty("idFlight", idFlight);
SoapObject result = (SoapObject) Invoke(c);
if (result == null)
setLastError("Failed to get path for flight - " + getLastError());
else {
try {
rgll = new LatLong[result.getPropertyCount()];
for (int i = 0; i < rgll.length; i++)
rgll[i] = new LatLong((SoapObject) result.getProperty(i));
} catch (Exception e) {
rgll = new LatLong[0];
setLastError(getLastError() + e.getMessage());
}
}
return rgll;
}
示例8: FromProperties
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
public void FromProperties(SoapObject so) {
Comment = ReadNullableString(so, "Comment");
VirtualPath = ReadNullableString(so, "VirtualPath");
URLFullImage = ReadNullableString(so, "URLFullImage");
ThumbnailFile = ReadNullableString(so, "ThumbnailFile");
Width = Integer.parseInt(so.getProperty("Width").toString());
Height = Integer.parseInt(so.getProperty("Height").toString());
WidthThumbnail = Integer.parseInt(so.getProperty("WidthThumbnail").toString());
HeightThumbnail = Integer.parseInt(so.getProperty("HeightThumbnail").toString());
if (so.hasProperty("Location")) {
SoapObject location = (SoapObject) so.getProperty("Location");
Location = new LatLong();
Location.FromProperties(location);
}
if (so.hasProperty("ImageType"))
ImageType = ImageFileType.valueOf(so.getProperty("ImageType").toString());
}
示例9: FromProperties
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
public void FromProperties(SoapObject so) {
idPropType = Integer.parseInt(so.getProperty("PropTypeID").toString());
szTitle = so.getProperty("Title").toString();
szSortKey = so.getPropertySafelyAsString("SortKey");
szFormatString = so.getProperty("FormatString").toString();
szDescription = ReadNullableString(so, "Description");
cptType = CFPPropertyType.valueOf(so.getProperty("Type").toString());
cptFlag = Integer.parseInt(so.getProperty("Flags").toString());
IsFavorite = Boolean.parseBoolean(so.getProperty("IsFavorite").toString());
SoapObject PrevVals = (SoapObject) so.getProperty("PreviousValues");
int cVals = PrevVals.getPropertyCount();
PreviousValues = new String[cVals];
for (int i = 0; i < cVals; i++)
PreviousValues[i] = PrevVals.getPropertyAsString(i);
}
示例10: FromProperties
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public void FromProperties(SoapObject so) {
Description = so.getProperty("Description").toString();
Value = Double.parseDouble(so.getProperty("Value").toString());
// Optional strings come through as "anyType" if they're not actually present, so check for that.
Object o = so.getProperty("SubDescription");
if (o != null && !o.toString().contains("anyType"))
SubDescription = o.toString();
NumericType = NumType.valueOf(so.getProperty("NumericType").toString());
if (so.hasProperty("Query")) {
SoapObject q = (SoapObject) so.getProperty("Query");
Query = new FlightQuery();
Query.FromProperties(q);
}
}
示例11: getAccessLevels
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private Map<Integer, String> getAccessLevels() {
Map<Integer, String> accessLevelMap = new LinkedHashMap<>();
try {
SoapObject soapObject = this.executeQueryAndGetSoapObject("mc_enum_access_levels", null);
if(soapObject!=null) {
Vector access = (Vector) soapObject.getProperty("return");
for(Object obj : access) {
SoapObject level = ((SoapObject)obj);
accessLevelMap.put(Integer.parseInt(level.getProperty("id").toString()), level.getProperty("name").toString());
}
}
} catch (Exception ex) {
Helper.printException(ex);
}
return accessLevelMap;
}
示例12: getRightsFromProject
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public Map.Entry<Integer, String> getRightsFromProject(int pid) {
Map.Entry<Integer, String> right = null;
MantisUser current = this.testConnection();
for(Map.Entry<Integer, String> entry : this.getAccessLevels().entrySet()) {
try {
SoapObject obj =
this.executeQueryAndGetSoapObject(
"mc_project_get_users",
new Object[][]{{"project_id", pid}, {"access", entry.getKey()}}
);
if(obj!=null) {
Vector objects = (Vector) obj.getProperty(0);
for(Object object : objects) {
SoapObject userData = (SoapObject) object;
if(checkAndGetProperty("name", userData).equals(current.getUserName())) {
right = new AbstractMap.SimpleEntry<>(entry);
}
}
}
} catch (Exception ex) {
Helper.printException(ex);
return null;
}
}
return right;
}
示例13: getProject
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private MantisProject getProject(SoapObject object) {
MantisProject project = new MantisProject(object.getProperty(1).toString());
try {
project.setId(Integer.parseInt(object.getProperty(0).toString()));
project.setEnabled(Boolean.parseBoolean(object.getProperty(3).toString()));
project.setDescription(object.getProperty(7).toString());
SoapObject access = (SoapObject) object.getProperty("access_min");
project.setAccess(Integer.parseInt(access.getProperty("id").toString()), access.getProperty("name").toString());
for(Object sub : ((Vector) object.getProperty(8))) {
project.addSubProject(getProject((SoapObject) sub));
}
} catch (Exception ex) {
Helper.printException(ex);
return null;
}
return project;
}
示例14: getIssue
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private MantisIssue getIssue(int sid,boolean small) {
MantisIssue issue = null;
try {
SoapObject obj =
this.executeQueryAndGetSoapObject(
"mc_issue_get",
new Object[][]{{"issue_id", sid}}
);
if(obj!=null) {
SoapObject soapObjIssue = (SoapObject) obj.getProperty(0);
issue = this.getIssueFromSoap(soapObjIssue, small);
}
} catch (Exception ex) {
Helper.printException(ex);
return null;
}
return issue;
}
示例15: getCategories
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
public List<String> getCategories(int pid) {
List<String> categoryList = new LinkedList<>();
try {
SoapObject obj =
this.executeQueryAndGetSoapObject(
"mc_project_get_categories",
new Object[][]{{"project_id", pid}}
);
if(obj!=null) {
for(Object object : ((Vector) obj.getProperty(0))) {
categoryList.add(object.toString());
}
}
} catch (Exception ex) {
return null;
}
return categoryList;
}