3 use FS::Daemon::Preforking qw( freeside_init1 freeside_init2 daemon_run );
5 use FS::XMLRPC_Lite; #XMLRPC::Lite for XMLRPC::Serializer
6 #and XMLRPC::Transport::HTTP
10 ##use FS::ClientAPI qw( load_clientapi_modules );
11 ##use FS::ClientAPI_XMLRPC; #FS::SelfService::XMLRPC;
16 #not utf-8 safe# base64 => [10, sub {$_[0] =~ /[^\x09\x0a\x0d\x20-\x7f]/}, 'as_base64'],
17 dateTime => [35, sub {$_[0] =~ /^\d{8}T\d\d:\d\d:\d\d$/}, 'as_dateTime'],
18 string => [40, sub {1}, 'as_string'],
21 use constant ME => 'xmlrpcd';
27 #load_clientapi_modules;
31 #FS::ClientAPI::Signup::clear_cache();
33 my $conf = new FS::Conf;
34 die "not running; xmlrpc_api conf option is off\n"
35 unless $conf->exists('xmlrpc_api');
36 die "not running; api_shared_secret conf option is not set\n"
37 unless $conf->config('api_shared_secret');
39 daemon_run( 'port' => 8008, 'handle_request' =>
43 my $serializer = new XMLRPC::Serializer(typelookup => \%typelookup);
45 #my $soap = SOAP::Transport::HTTP::Server
46 my $soap = XMLRPC::Transport::HTTP::Server
48 -> dispatch_to('FS::API')
49 -> serializer($serializer);
51 $soap->request($request);
54 return $soap->response;