本文整理汇总了Java中org.ksoap2.serialization.SoapObject.getPropertyInfo方法的典型用法代码示例。如果您正苦于以下问题:Java SoapObject.getPropertyInfo方法的具体用法?Java SoapObject.getPropertyInfo怎么用?Java SoapObject.getPropertyInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ksoap2.serialization.SoapObject
的用法示例。
在下文中一共展示了SoapObject.getPropertyInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseMap
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
private static void parseMap(SoapObject in, Map outMap) throws IllegalAccessException, InstantiationException {
// Get the type of the elements in the collection
ParameterizedType fieldParametrizedType = (ParameterizedType) outMap.getClass().getGenericSuperclass();
Class valType = (Class) fieldParametrizedType.getActualTypeArguments()[1];
int n = in.getPropertyCount();
for (int i = 0; i < n; ++i){
PropertyInfo propInfo = new PropertyInfo();
in.getPropertyInfo(i, propInfo);
Object soapElem = in.getProperty(i);
String key = propInfo.getName();
Object elem;
if ( soapElem == null || canBeAssignedDirectly(soapElem.getClass()) ) {
elem = soapElem;
}
else {
elem = valType.newInstance();
parse((SoapObject) soapElem, elem);
}
outMap.put(key, elem);
}
}
示例2: doInBackground
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
protected Void doInBackground(String... params) {
SoapObject soapObject = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo propertyInfo = new PropertyInfo();
propertyInfo.setName("strPrijemniBroj");
propertyInfo.setValue(params[0]);
propertyInfo.setType(String.class);
soapObject.addProperty(propertyInfo);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
envelope.setOutputSoapObject(soapObject);
envelope.dotNet = true;
HttpTransportSE httpTransportSE = new HttpTransportSE(URL);
try {
httpTransportSE.call(SOAP_ACTION, envelope);
SoapObject res = (SoapObject) envelope.getResponse();
PropertyInfo diffGram = res.getPropertyInfo(1);
SoapObject anyType = (SoapObject) diffGram.getValue();
PropertyInfo documentElement = anyType.getPropertyInfo(0);
SoapObject anyType2 = (SoapObject) documentElement.getValue();
for (int i = 0; i < anyType2.getPropertyCount(); i++) {
PropertyInfo tableName = anyType2.getPropertyInfo(i);
SoapObject anyType3 = (SoapObject) tableName.getValue();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
SimpleDateFormat output = new SimpleDateFormat("HH:mm:ss dd/MM/yyyy");
Date d = sdf.parse(anyType3.getPropertyInfo(5).getValue().toString());
String formattedTime = output.format(d);
messages.add(new StatusMessage(formattedTime,
anyType3.getPropertyInfo(1).getValue().toString(),
anyType3.getPropertyInfo(2).getValue().toString(),
anyType3.getPropertyInfo(7).getValue().toString(),
anyType3.getPropertyInfo(4).getValue().toString()
));
}
} catch (Exception e) {
}
return null;
}
示例3: doInBackground
import org.ksoap2.serialization.SoapObject; //导入方法依赖的package包/类
@Override
protected Integer doInBackground(PostParcel... params) {
parcel = params[0];
SoapObject soapObject = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo propertyInfo = new PropertyInfo();
propertyInfo.setName("strPrijemniBroj");
propertyInfo.setValue(params[0].getParcelNo());
propertyInfo.setType(String.class);
soapObject.addProperty(propertyInfo);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER12);
envelope.setOutputSoapObject(soapObject);
envelope.dotNet = true;
HttpTransportSE httpTransportSE = new HttpTransportSE(URL);
try {
httpTransportSE.call(SOAP_ACTION, envelope);
SoapObject res = (SoapObject) envelope.getResponse();
PropertyInfo diffGram = res.getPropertyInfo(1);
SoapObject anyType = (SoapObject) diffGram.getValue();
PropertyInfo documentElement = anyType.getPropertyInfo(0);
SoapObject anyType2 = (SoapObject) documentElement.getValue();
return anyType2.getPropertyCount();
} catch (Exception e) {
}
return 0;
}