1 package FS::SelfService::XMLRPC;
5 FS::SelfService::XMLRPC - Freeside XMLRPC accessible self-service API
11 Use this API to implement your own client "self-service" module vi XMLRPC.
13 Each routine described in L<FS::SelfService> is available vi XMLRPC. All
14 values are passed to the selfservice-server in a struct of strings. The
15 return values are in a struct as strings, arrays, or structs as appropriate
16 for the values described in L<FS::SelfService>.
22 L<freeside-selfservice-clientd>, L<freeside-selfservice-server>,L<FS::SelfService>
27 use vars qw($DEBUG $AUTOLOAD);
31 $FS::SelfService::DEBUG = $DEBUG;
35 $call =~ s/^FS::SelfService::XMLRPC:://;
36 if (exists($FS::SelfService::autoload{$call})) {
37 shift; #discard package name;
38 $call = "FS::SelfService::$call";
42 die "No such procedure: $call";
46 package SOAP::Transport::HTTP::Daemon; # yuck
48 use POSIX qw(:sys_wait_h);
50 no warnings 'redefine';
53 my $self = shift->new;
55 local $SIG{CHLD} = 'IGNORE';
58 while (my $c = $self->accept) {
62 $kid = waitpid(-1, WNOHANG);
63 warn "found kid $kid";
69 if ( not defined $pid ) {
70 warn "fork() failed: $!";
73 while (my $r = $c->get_request) {
76 $c->send_response($self->response);
78 # replaced ->close, thanks to Sean Meisner <Sean.Meisner@VerizonWireless.com>
79 # shutdown() doesn't work on AIX. close() is used in this case. Thanks to Jos Clijmans <jos.clijmans@recyfin.be>
80 UNIVERSAL::isa($c, 'shutdown') ? $c->shutdown(2) : $c->close();