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 as the
14 method FS.SelfService.XMLRPC.B<method>. All values are passed to the
15 selfservice-server in a struct of strings. The return values are in a
16 struct as strings, arrays, or structs as appropriate for the values
17 described in L<FS::SelfService>.
23 L<freeside-selfservice-clientd>, L<freeside-selfservice-server>,L<FS::SelfService>
28 use vars qw($DEBUG $AUTOLOAD);
32 $FS::SelfService::DEBUG = $DEBUG;
36 $call =~ s/^FS::SelfService::XMLRPC:://;
37 if (exists($FS::SelfService::autoload{$call})) {
38 shift; #discard package name;
39 $call = "FS::SelfService::$call";
43 die "No such procedure: $call";
47 package SOAP::Transport::HTTP::Daemon; # yuck
49 use POSIX qw(:sys_wait_h);
51 no warnings 'redefine';
54 my $self = shift->new;
56 local $SIG{CHLD} = 'IGNORE';
59 while (my $c = $self->accept) {
63 $kid = waitpid(-1, WNOHANG);
64 warn "found kid $kid";
70 if ( not defined $pid ) {
71 warn "fork() failed: $!";
74 while (my $r = $c->get_request) {
77 $c->send_response($self->response);
79 # replaced ->close, thanks to Sean Meisner <Sean.Meisner@VerizonWireless.com>
80 # shutdown() doesn't work on AIX. close() is used in this case. Thanks to Jos Clijmans <jos.clijmans@recyfin.be>
81 UNIVERSAL::isa($c, 'shutdown') ? $c->shutdown(2) : $c->close();