#! --PERL-- # $Id: sympa_soap_server.fcgi.in 10083 2014-01-01 00:12:12Z sikeda $ # Sympa - SYsteme de Multi-Postage Automatique # # Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel # Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites # Copyright (c) 2011, 2012, 2013, 2014 GIP RENATER # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . use SOAP::Lite; # Use this line for more debug facility #use SOAP::Lite +trace; use SOAP::Transport::HTTP; use lib '--modulesdir--'; ## Defines SOAP::Transport::HTTP::FCGI::Sympa with a modified handle() use SympaTransport; use Getopt::Long; use strict; ## Sympa API use tt2; use List; use mail; use Conf; use Log; use Language; use sympasoap; use Sympa::Constants; ## WWSympa librairies use cookielib; my $birthday = time ; ## Configuration my $wwsconf = {}; ## Change to your wwsympa.conf location my $conf_file = Sympa::Constants::WWSCONFIG; my $sympa_conf_file = Sympa::Constants::CONFIG; ## Load config unless ($wwsconf = &wwslib::load_config($conf_file)) { &Log::fatal_err('Unable to load config file %s', $conf_file); } ## Load sympa config unless (&Conf::load($sympa_conf_file)) { &Log::fatal_err('Unable to load sympa config file %s', $sympa_conf_file); } &Log::set_log_level($Conf{'log_level'}) if ($Conf{'log_level'}); ## Open log $wwsconf->{'log_facility'}||= $Conf{'syslog'}; &Log::do_openlog($wwsconf->{'log_facility'}, $Conf{'log_socket_type'}, 'soap'); &Log::do_log('info', 'SOAP server launched'); unless ($List::use_db = &List::check_db_connect()) { &do_log('err','SOAP server requires a RDBMS to run'); } my $pinfo = &List::_apply_defaults(); ## The process should not fork for sending mail ## Messages will be spooled instead &mail::set_send_spool($Conf{'queue'}); ## Loading all Lists at startup, in order to increase execution speed my $all_lists = &List::get_lists('*'); foreach my $list (@$all_lists){ ## Nothing to do here } ############################################################################################## # Soap part ############################################################################################## my $server = SOAP::Transport::HTTP::FCGI::Sympa->new(); #$server->dispatch_with({'urn:Sympa' => 'sympasoap'}); $server->dispatch_to('--modulesdir--','sympasoap'); $server->handle($birthday);