ScriptAlias /sympasoap /usr/lib/cgi-bin/sympa/sympa_soap_server-wrapper.fcgi
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=<the password> md5password 5ebe2294ecd0e0f08eab7690d2a6ee69 # # the comma separated list of vars the trusted application can set. proxy_for_variables USER_EMAIL,remote_host
## The base URL of Sympa's SOAP server
soap_url https://listes.example.org/sympasoap
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
<?php // Sympa SOAP webservice WSDL URL define('SYMPA_WSDL_URL','https://listes.example/wws/wsdl'); // Sympa SOAP webservice remote application name define('SYMPA_REMOTE_APP_NAME','LdapSaisie'); // Sympa SOAP webservice remote application password define('SYMPA_REMOTE_APP_PASSWORD','secret'); // Sympa robot host name define('SYMPA_HOST','listes.example.org'); // Sympa listmaster email used by LdapSaisie define('SYMPA_LISTMASTER_EMAIL','ldapsaisie@example.org');
<?php function make_sympa_soap_request($method, $params=array()) { try { $client = new SoapClient(SYMPA_WSDL_URL); $result = $client->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)); }