====== Sympa ====== ===== Webservice SOAP ===== ==== Activation ==== - Dans la configuration Apache, activer le //ScriptAlias// spécifique à l'API SOAP : ScriptAlias /sympasoap /usr/lib/cgi-bin/sympa/sympa_soap_server-wrapper.fcgi - Dans la configuration de Sympa : - Créer le fichier ///etc/sympa/trusted_applications.conf//. Exemple : trusted_application # name of the trusted application. This is the appname soap element name LdapSaisie # # the md5 digest of the application pasword. You can get it with : # /usr/lib/sympa/bin/sympa.pl --md5_digest= md5password 5ebe2294ecd0e0f08eab7690d2a6ee69 # # the comma separated list of vars the trusted application can set. proxy_for_variables USER_EMAIL,remote_host - Dans le fichier //robot.conf// de votre domaine de liste de messagerie (///etc/sympa/listes.example.org/robot.conf// par exemple), ajouter la directive //soap_url// : ## The base URL of Sympa's SOAP server soap_url https://listes.example.org/sympasoap - Recharger la configuration de Sympa et d'Apache service sympa reload service apache2 reload Vous devriez désormais avoir accès au ''WSDL'' de l'API SOAP : curl https://listes.example.org/wws/wsdl Le fichier //WSDL// est au format //XML//. Dans un navigateur, l'accès à ce fichier affiche le plus souvent une page blanche et il faut alors afficher les sources de la page pour voir son contenu. ==== Exemple d'utilisation en PHP ==== === Configuration === === Requêtes === authenticateRemoteAppAndRun( SYMPA_REMOTE_APP_NAME, SYMPA_REMOTE_APP_PASSWORD, "USER_EMAIL=".SYMPA_LISTMASTER_EMAIL.",SYMPA_ROBOT=".SYMPA_HOST, $method, $params ); } catch (SoapFault $fault) { error_log(sprintf("Sympa SOAP : An error occured calling Sympa SOAP webservice. The fault code return is %s with message : %s", $fault->faultcode, $fault->faultstring)); return False; } return $result; } function getListMailingLists() { return make_sympa_soap_request('complexLists'); } function getMailingListInfos($list) { return make_sympa_soap_request('info', array($list)); } function getMailingListMembers($list) { return make_sympa_soap_request('review', array($list)); }