use of org.ksoap2.serialization.AttributeInfo 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.AttributeInfo 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;
}
Aggregations