Search in sources :

Example 1 with PropertyInfo

use of org.ksoap2.serialization.PropertyInfo in project ETSMobile-Android2 by ApplETS.

the class WebServiceSoap method Recherche.

public ArrayOfFicheEmploye Recherche(final String FiltreNom, final String FiltrePrenom, final String FiltreServiceCode) throws Exception {
    return (ArrayOfFicheEmploye) execute(new IWcfMethod() {

        @Override
        public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
            ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
            SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "Recherche");
            __envelope.setOutputSoapObject(__soapReq);
            PropertyInfo __info = null;
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "FiltreNom";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(FiltreNom);
            __soapReq.addProperty(__info);
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "FiltrePrenom";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(FiltrePrenom);
            __soapReq.addProperty(__info);
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "FiltreServiceCode";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(FiltreServiceCode);
            __soapReq.addProperty(__info);
            return __envelope;
        }

        @Override
        public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
            return (ArrayOfFicheEmploye) getResult(ArrayOfFicheEmploye.class, __result, "RechercheResult", __envelope);
        }
    }, "http://etsmtl.ca/Recherche");
}
Also used : SoapObject(org.ksoap2.serialization.SoapObject) PropertyInfo(org.ksoap2.serialization.PropertyInfo) ArrayOfFicheEmploye(ca.etsmtl.applets.etsmobile.model.ArrayOfFicheEmploye)

Example 2 with PropertyInfo

use of org.ksoap2.serialization.PropertyInfo in project ETSMobile-Android2 by ApplETS.

the class ExtendedSoapSerializationEnvelope method writeProperty.

@Override
protected void writeProperty(XmlSerializer writer, Object obj, PropertyInfo type) throws IOException {
    if (obj == null) {
        writer.attribute(xsi, "nil", "true");
        return;
    }
    if (reverseReferencesTable.containsKey(obj)) {
        // this object has been already serialized so use Ref instead
        String id = reverseReferencesTable.get(obj);
        writer.attribute(MsNs, "Ref", id);
        return;
    } else {
        if (obj instanceof IReferenceObject) {
            String id = String.format("i%d", reverseReferencesTable.size() + 1);
            reverseReferencesTable.put(obj, id);
            writer.attribute(MsNs, "Id", id);
        }
        Object[] qName = getInfo(null, obj);
        if (!type.multiRef && qName[2] == null) {
            if (!implicitTypes || (obj.getClass() != type.type && !(obj instanceof Vector) && type.type != String.class)) {
                String xmlName = Helper.getKeyByValue(classNames, obj.getClass());
                if (xmlName != null) {
                    String[] parts = xmlName.split("\\^\\^");
                    String prefix = writer.getPrefix(parts[0], true);
                    writer.attribute(xsi, TYPE_LABEL, prefix + ":" + parts[1]);
                } else {
                    String prefix = writer.getPrefix(type.namespace, true);
                    writer.attribute(xsi, TYPE_LABEL, prefix + ":" + obj.getClass().getSimpleName());
                }
            }
            try {
                Method method = this.getClass().getSuperclass().getDeclaredMethod("writeElement", XmlSerializer.class, Object.class, PropertyInfo.class, Object.class);
                method.setAccessible(true);
                method.invoke(this, writer, obj, type, qName[QNAME_MARSHAL]);
            } catch (NoSuchMethodException e) {
                // To change body of catch statement
                e.printStackTrace();
            // use File | Settings | File
            // Templates.
            } catch (IllegalAccessException e) {
                // To change body of catch statement
                e.printStackTrace();
            // use File | Settings | File
            // Templates.
            } catch (InvocationTargetException e) {
                // To change body of catch statement
                e.printStackTrace();
            // use File | Settings | File
            // Templates.
            }
        // writeElement(writer, obj, type, qName[QNAME_MARSHAL]);
        } else {
            super.writeProperty(writer, obj, type);
        }
    }
}
Also used : SoapObject(org.ksoap2.serialization.SoapObject) Method(java.lang.reflect.Method) Vector(java.util.Vector) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 3 with PropertyInfo

use of org.ksoap2.serialization.PropertyInfo in project ETSMobile-Android2 by ApplETS.

the class Helper method convertToHeader.

public static Element convertToHeader(Object obj, String namespace, String name) {
    Element parentElement = new org.kxml2.kdom.Element().createElement(namespace, name);
    if (obj == null) {
        return parentElement;
    }
    if (obj instanceof KvmSerializable) {
        KvmSerializable soapObject = (KvmSerializable) obj;
        for (int i = 0; i < soapObject.getPropertyCount(); i++) {
            PropertyInfo info = new PropertyInfo();
            soapObject.getPropertyInfo(i, new Hashtable(), info);
            info.setValue(soapObject.getProperty(i));
            Element el1 = convertToHeader(info.getValue(), info.getNamespace(), info.getName());
            parentElement.addChild(Node.ELEMENT, el1);
        }
    } else {
        String value = obj.toString();
        parentElement.addChild(org.kxml2.kdom.Node.TEXT, value);
    }
    return parentElement;
}
Also used : Hashtable(java.util.Hashtable) Element(org.kxml2.kdom.Element) KvmSerializable(org.ksoap2.serialization.KvmSerializable) PropertyInfo(org.ksoap2.serialization.PropertyInfo) Element(org.kxml2.kdom.Element)

Example 4 with PropertyInfo

use of org.ksoap2.serialization.PropertyInfo in project ETSMobile-Android2 by ApplETS.

the class SignetsMobileSoap method listeCoursIntervalleSessions.

/**
	 * Liste des cours de l'��tudiant entre deux sessions : sigle, groupe,
	 * session, programme, cote finale, nombre de cr��dits et titre du cours,
	 * tri��e par session et sigle.
	 */
public ListeDeCours listeCoursIntervalleSessions(final String codeAccesUniversel, final String motPasse, final String SesDebut, final String SesFin) throws Exception {
    return (ListeDeCours) execute(new IWcfMethod() {

        @Override
        public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
            ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
            SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "listeCoursIntervalleSessions");
            __envelope.setOutputSoapObject(__soapReq);
            PropertyInfo __info = null;
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "codeAccesUniversel";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(codeAccesUniversel);
            __soapReq.addProperty(__info);
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "motPasse";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(motPasse);
            __soapReq.addProperty(__info);
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "SesDebut";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(SesDebut);
            __soapReq.addProperty(__info);
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "SesFin";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(SesFin);
            __soapReq.addProperty(__info);
            return __envelope;
        }

        @Override
        public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
            return (ListeDeCours) getResult(ListeDeCours.class, __result, "listeCoursIntervalleSessionsResult", __envelope);
        }
    }, "http://etsmtl.ca/listeCoursIntervalleSessions");
}
Also used : ListeDeCours(ca.etsmtl.applets.etsmobile.model.ListeDeCours) SoapObject(org.ksoap2.serialization.SoapObject) PropertyInfo(org.ksoap2.serialization.PropertyInfo)

Example 5 with PropertyInfo

use of org.ksoap2.serialization.PropertyInfo in project ETSMobile-Android2 by ApplETS.

the class SignetsMobileSoap method listeProgrammes.

/**
	 * Liste des programmes d'��tudes de l'��tudiant: code, libell��, moyenne,
	 * cr��dits r��ussis, etc.)
	 */
public listeDesProgrammes listeProgrammes(final String codeAccesUniversel, final String motPasse) throws Exception {
    return (listeDesProgrammes) execute(new IWcfMethod() {

        @Override
        public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
            ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
            SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "listeProgrammes");
            __envelope.setOutputSoapObject(__soapReq);
            PropertyInfo __info = null;
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "codeAccesUniversel";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(codeAccesUniversel);
            __soapReq.addProperty(__info);
            __info = new PropertyInfo();
            __info.namespace = "http://etsmtl.ca/";
            __info.name = "motPasse";
            __info.type = PropertyInfo.STRING_CLASS;
            __info.setValue(motPasse);
            __soapReq.addProperty(__info);
            return __envelope;
        }

        @Override
        public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
            return (listeDesProgrammes) getResult(listeDesProgrammes.class, __result, "listeProgrammesResult", __envelope);
        }
    }, "http://etsmtl.ca/listeProgrammes");
}
Also used : SoapObject(org.ksoap2.serialization.SoapObject) ca.etsmtl.applets.etsmobile.model.listeDesProgrammes(ca.etsmtl.applets.etsmobile.model.listeDesProgrammes) PropertyInfo(org.ksoap2.serialization.PropertyInfo)

Aggregations

PropertyInfo (org.ksoap2.serialization.PropertyInfo)23 SoapObject (org.ksoap2.serialization.SoapObject)22 SoapPrimitive (org.ksoap2.serialization.SoapPrimitive)4 ArrayOfFicheEmploye (ca.etsmtl.applets.etsmobile.model.ArrayOfFicheEmploye)2 ListeDeCours (ca.etsmtl.applets.etsmobile.model.ListeDeCours)2 ArrayOfFicheEmployeDate (ca.etsmtl.applets.etsmobile.model.ArrayOfFicheEmployeDate)1 ArrayOfService (ca.etsmtl.applets.etsmobile.model.ArrayOfService)1 Etudiant (ca.etsmtl.applets.etsmobile.model.Etudiant)1 FicheEmploye (ca.etsmtl.applets.etsmobile.model.FicheEmploye)1 ListeDeSessions (ca.etsmtl.applets.etsmobile.model.ListeDeSessions)1 ListeDesElementsEvaluation (ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation)1 ca.etsmtl.applets.etsmobile.model.listeCoursHoraire (ca.etsmtl.applets.etsmobile.model.listeCoursHoraire)1 ca.etsmtl.applets.etsmobile.model.listeDesActivitesEtProf (ca.etsmtl.applets.etsmobile.model.listeDesActivitesEtProf)1 ca.etsmtl.applets.etsmobile.model.listeDesCoequipiers (ca.etsmtl.applets.etsmobile.model.listeDesCoequipiers)1 ca.etsmtl.applets.etsmobile.model.listeDesProgrammes (ca.etsmtl.applets.etsmobile.model.listeDesProgrammes)1 ca.etsmtl.applets.etsmobile.model.listeHoraireExamensFinaux (ca.etsmtl.applets.etsmobile.model.listeHoraireExamensFinaux)1 ca.etsmtl.applets.etsmobile.model.listeJoursRemplaces (ca.etsmtl.applets.etsmobile.model.listeJoursRemplaces)1 ca.etsmtl.applets.etsmobile.model.listeSeances (ca.etsmtl.applets.etsmobile.model.listeSeances)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1