Search in sources :

Example 26 with SoapObject

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

the class SignetsMobileSoap method listeSessions.

/**
	 * Liste de toutes les sessions o�� l'��tudiant a ��t�� actif �� l'��TS, en
	 * version courte (A2011) et longue (Automne 2011)
	 */
public ListeDeSessions listeSessions(final String codeAccesUniversel, final String motPasse) throws Exception {
    return (ListeDeSessions) execute(new IWcfMethod() {

        @Override
        public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
            ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
            SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "listeSessions");
            __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 (ListeDeSessions) getResult(ListeDeSessions.class, __result, "listeSessionsResult", __envelope);
        }
    }, "http://etsmtl.ca/listeSessions");
}
Also used : SoapObject(org.ksoap2.serialization.SoapObject) ListeDeSessions(ca.etsmtl.applets.etsmobile.model.ListeDeSessions) PropertyInfo(org.ksoap2.serialization.PropertyInfo)

Example 27 with SoapObject

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

the class SignetsMobileSoap method echo.

public String echo(final String chaine) throws Exception {
    return (String) execute(new IWcfMethod() {

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

        @Override
        public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
            Object obj = __result.getProperty("echoResult");
            if (obj != null && obj.getClass().equals(SoapPrimitive.class)) {
                SoapPrimitive j = (SoapPrimitive) __result.getProperty("echoResult");
                return j.toString();
            }
            return null;
        }
    }, "http://etsmtl.ca/echo");
}
Also used : SoapObject(org.ksoap2.serialization.SoapObject) SoapObject(org.ksoap2.serialization.SoapObject) PropertyInfo(org.ksoap2.serialization.PropertyInfo) SoapPrimitive(org.ksoap2.serialization.SoapPrimitive)

Example 28 with SoapObject

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

the class SignetsMobileSoap method execute.

protected Object execute(IWcfMethod wcfMethod, String methodName) throws java.lang.Exception {
    org.ksoap2.transport.Transport __httpTransport = createTransport();
    ExtendedSoapSerializationEnvelope __envelope = wcfMethod.CreateSoapEnvelope();
    sendRequest(methodName, __envelope, __httpTransport);
    Object __retObj = __envelope.bodyIn;
    if (__retObj instanceof SoapFault) {
        SoapFault __fault = (SoapFault) __retObj;
        throw convertToException(__fault, __envelope);
    } else {
        SoapObject __result = (SoapObject) __retObj;
        return wcfMethod.ProcessResult(__envelope, __result);
    }
}
Also used : SoapFault(org.ksoap2.SoapFault) SoapObject(org.ksoap2.serialization.SoapObject) SoapObject(org.ksoap2.serialization.SoapObject)

Example 29 with SoapObject

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

the class SignetsMobileSoap method HelloWorld.

public String HelloWorld() throws Exception {
    return (String) execute(new IWcfMethod() {

        @Override
        public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
            ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
            SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "HelloWorld");
            __envelope.setOutputSoapObject(__soapReq);
            PropertyInfo __info = null;
            return __envelope;
        }

        @Override
        public Object ProcessResult(ExtendedSoapSerializationEnvelope __envelope, SoapObject __result) throws Exception {
            Object obj = __result.getProperty("HelloWorldResult");
            if (obj != null && obj.getClass().equals(SoapPrimitive.class)) {
                SoapPrimitive j = (SoapPrimitive) __result.getProperty("HelloWorldResult");
                return j.toString();
            }
            return null;
        }
    }, "http://etsmtl.ca/HelloWorld");
}
Also used : SoapObject(org.ksoap2.serialization.SoapObject) SoapObject(org.ksoap2.serialization.SoapObject) PropertyInfo(org.ksoap2.serialization.PropertyInfo) SoapPrimitive(org.ksoap2.serialization.SoapPrimitive)

Example 30 with SoapObject

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

the class SignetsMobileSoap method infoEtudiant.

/**
	 * Information de base sur l'��tudiant: nom, pr��nom, code permanent, solde
	 */
public Etudiant infoEtudiant(final String codeAccesUniversel, final String motPasse) throws Exception {
    return (Etudiant) execute(new IWcfMethod() {

        @Override
        public ExtendedSoapSerializationEnvelope CreateSoapEnvelope() {
            ExtendedSoapSerializationEnvelope __envelope = createEnvelope();
            SoapObject __soapReq = new SoapObject("http://etsmtl.ca/", "infoEtudiant");
            __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 (Etudiant) getResult(Etudiant.class, __result, "infoEtudiantResult", __envelope);
        }
    }, "http://etsmtl.ca/infoEtudiant");
}
Also used : Etudiant(ca.etsmtl.applets.etsmobile.model.Etudiant) SoapObject(org.ksoap2.serialization.SoapObject) PropertyInfo(org.ksoap2.serialization.PropertyInfo)

Aggregations

SoapObject (org.ksoap2.serialization.SoapObject)29 PropertyInfo (org.ksoap2.serialization.PropertyInfo)23 SoapPrimitive (org.ksoap2.serialization.SoapPrimitive)5 IOException (java.io.IOException)3 Handler (android.os.Handler)2 Message (android.os.Message)2 ArrayOfFicheEmploye (ca.etsmtl.applets.etsmobile.model.ArrayOfFicheEmploye)2 ListeDeCours (ca.etsmtl.applets.etsmobile.model.ListeDeCours)2 Entry (java.util.Map.Entry)2 SoapSerializationEnvelope (org.ksoap2.serialization.SoapSerializationEnvelope)2 HttpResponseException (org.ksoap2.transport.HttpResponseException)2 HttpTransportSE (org.ksoap2.transport.HttpTransportSE)2 Element (org.kxml2.kdom.Element)2 XmlPullParserException (org.xmlpull.v1.XmlPullParserException)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