1Apache::XMLRPC(3) User Contributed Perl Documentation Apache::XMLRPC(3)
2
3
4
6 Apache::XMLRPC - serve XML-RPC requests from Apache
7
9 ##
10 ## Directives for your Apache config file.
11 ##
12 <Location /RPC2>
13 SetHandler perl-script
14 PerlHandler Apache::XMLRPC
15 PerlSetVar XMLRPC_Config /usr/local/apache/xml-rpc/services
16 </Location>
17
18
19 ##
20 ## In the 'services' file referenced above by 'XMLRPC_Config'
21 ##
22 sub foo {
23 ...
24 }
25
26 sub bar {
27 ...
28 }
29
30 $map = {
31 foo => \&foo,
32 bar => \&bar,
33 };
34
35 1;
36
38 Apache::XMLRPC serves Userland XML-RPC requests from Apache/mod_perl
39 using the Frontier::RPC2 module.
40
41 Configuring Apache::XMLRPC to work under mod_perl is a two step
42 process. First, you must declare a "<Location>" directive in your
43 Apache configuration file which tells Apache to use the content handler
44 found in the Apache::XMLRPC module and defines a variable which tells
45 the module where to find your services. Then, you must define the
46 services.
47
48 Apache Configuration
49 Apache configuration is as simple as the "<Location>" directive shown
50 in the synopsis above. Any directive allowed by Apache inside a
51 "<Location>" block is allowed here, but the three lines shown above are
52 required. Pay close attention to the 'PerlSetVar XMLRPC_Config ...'
53 line as this is where you tell Apache where to find your services.
54 This file may reside anywhere accessable by Apache.
55
56 Defining Services
57 To actually define the XML-RPC routines that will be served, they must
58 reside in the file referenced by the 'PerlSetVar XMLRPC_Config ...'
59 directive in the Apache configuration file. In this file you may place
60 as many Perl subroutines as you like, but only those which are
61 explicitly published will be available to your XML-RPC clients.
62
63 To publish a subroutine, it must be included in the hash reference
64 named $map (the hash reference must have this name as this is the
65 variable that the Apache::XMLRPC passes to Frontier::RPC2::serve to
66 actually service each request) The hash reference must be defined in
67 this "services" file.
68
69 The keys of the hash are the service names visible to the XML-RPC
70 clients while the hash values are references to the subroutines you
71 wish to make public. There is no requirement that the published
72 service names match those of their associated subroutines, but it does
73 make administration a little easier.
74
76 perl(1), Frontier::RPC2(3)
77
78 <http://www.scripting.com/frontier5/xml/code/rpc.html>
79
81 Ed Hill <ed-hill@uiowa.edu> is the original author.
82
83 Tim Peoples <tep@colltech.com> added a few tweaks and all the
84 documenation.
85
86
87
88perl v5.36.0 2023-01-20 Apache::XMLRPC(3)