Search in sources :

Example 1 with AttributeContainer

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);
}
Also used : AttributeInfo(org.ksoap2.serialization.AttributeInfo) AttributeContainer(org.ksoap2.serialization.AttributeContainer)

Example 2 with AttributeContainer

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;
}
Also used : AttributeInfo(org.ksoap2.serialization.AttributeInfo)

Example 3 with AttributeContainer

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;
}
Also used : SoapObject(org.ksoap2.serialization.SoapObject)

Aggregations

AttributeInfo (org.ksoap2.serialization.AttributeInfo)2 AttributeContainer (org.ksoap2.serialization.AttributeContainer)1 SoapObject (org.ksoap2.serialization.SoapObject)1