Do you want your Perl code on one server to call your PHP functions on another? "Impossible!" you say? Not with XML-RPC. XML-RPC is a standard way for any application to make requests and recieve responses from methods written in any language. Interested? I knew you would be.
An XML-RPC call is sent from a client to a server via HTTP POST. This allows XML-RPC applications to work fairly easily behind firewalls, as port 80 is almost always open.
The first part of the request is simply a standard HTML post
request. It's the data sent in the body of the request that interests us.
The <methodCall> tags simply encapsulate the call, with all the parameters enclosed in <params> and each parameter enclosed in <param>.
Parameters are specified enclosed in tags that tell the application what type of parameter they are. In this case, "Lucas" is a string, so it is enclosed in <string>, but there are a lot more parameter types:
<i4> or <int>
four-byte signed integer
10
<boolean>
0 (false) or 1 (true)
1
<string>
ASCII string
Hello, DevShed!
<double>
double-precision signed
floating point number
-21.2544
<dateTime.iso8601>
date/time
20011219T12:05:26
<base64>
base64-encoded binary
eW91IGNhbid0IHJlYWQgdGhpcyE=
In addition to
the basic types, there are also <struct>s and <array>s, <struct>s containing any number of <member>s that consist of <name>s and <value>s (specified in the same manner as <param>s):