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");
}
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);
}
}
}
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;
}
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");
}
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");
}
Aggregations