use of org.ksoap2.serialization.AttributeContainer in project ETSMobile-Android2 by ApplETS.
the class ExtendedSoapSerializationEnvelope method writeObjectBody.
@Override
public void writeObjectBody(XmlSerializer writer, KvmSerializable obj) throws IOException {
if (obj instanceof AttributeContainer) {
AttributeContainer soapObject = (AttributeContainer) obj;
int cnt = soapObject.getAttributeCount();
for (int counter = 0; counter < cnt; counter++) {
AttributeInfo attributeInfo = new AttributeInfo();
soapObject.getAttributeInfo(counter, attributeInfo);
writer.attribute(attributeInfo.getNamespace(), attributeInfo.getName(), attributeInfo.getValue() != null ? attributeInfo.getValue().toString() : "");
}
}
super.writeObjectBody(writer, obj);
}
use of org.ksoap2.serialization.AttributeContainer in project ETSMobile-Android2 by ApplETS.
the class Helper method getAttribute.
public static Object getAttribute(AttributeContainer obj, String name, String namespace) {
for (int i = 0; i < obj.getAttributeCount(); i++) {
AttributeInfo info = new AttributeInfo();
obj.getAttributeInfo(i, info);
if (info.name.equals(name) && info.namespace.equals(namespace)) {
return info.getValue();
}
}
return null;
}
use of org.ksoap2.serialization.AttributeContainer in project ETSMobile-Android2 by ApplETS.
the class SignetsMobileSoap method getResult.
Object getResult(Class destObj, SoapObject source, String resultName, ExtendedSoapSerializationEnvelope __envelope) throws Exception {
if (source.hasProperty(resultName)) {
Object j = source.getProperty(resultName);
if (j == null) {
return null;
}
Object instance = __envelope.get((AttributeContainer) j, destObj);
return instance;
} else if (source.getName().equals(resultName)) {
Object instance = __envelope.get(source, destObj);
return instance;
}
return null;
}
Aggregations