XML-RPC
The original XML remote calls — simple, well-understood, and widely supported since 1998.
What Is XML-RPC?
XML-RPC is a remote procedure call protocol created in 1998 by Dave Winer and Microsoft. It was the first widely-adopted protocol to use XML over HTTP for machine-to-machine communication, and it directly inspired SOAP (which evolved from XML-RPC by adding namespaces, headers, and the WS-* extensions). While SOAP grew complex, XML-RPC stayed simple — and that simplicity is why it endures today.
An XML-RPC request is an HTTP POST containing a <methodCall>
XML document. Inside that document are two things: a <methodName>
(the procedure to invoke, like getOfficialByName) and an optional
<params> block containing the arguments. Each parameter is
wrapped in a <value> tag with a type indicator:
<string>, <int>,
<double>, <boolean>,
<dateTime.iso8601>, <base64>,
<array>, or <struct>.
The server responds with a <methodResponse> document containing
either a <params> block (on success) or a <fault>
block (on error). A fault contains a faultCode (integer) and a
faultString (human-readable message). There is no concept of WSDL or
schema files — the method list and parameter types are typically documented informally
or discovered through a system.listMethods introspection call.
XML-RPC is still actively used in many systems: WordPress exposes its entire remote
management API via XML-RPC (/xmlrpc.php), many legacy enterprise systems
and embedded devices speak XML-RPC, and some content management systems and publishing
tools rely on it. If you have an XML-RPC API that works and you do not want to
rewrite it, Opsalis can monetize it exactly as it is.
How XML-RPC Works with Opsalis
XML-RPC is method-based, like JSON-RPC, but uses XML for encoding. The Opsalis handler bridges the XML serialization gap so consumers work with clean JSON.
- Owner provides a method list. Upload a JSON file listing each XML-RPC method name, its parameter types, and response structure. The handler uses this to generate OpenAPI endpoints and validate calls.
-
Handler constructs
methodCallXML. When a consumer request arrives as JSON, the handler converts each parameter to the appropriate XML-RPC type (<string>,<int>,<struct>, etc.) and wraps everything in a<methodCall>document. -
Handler parses
methodResponseXML back to JSON. The XML-RPC response is parsed, type-converted (XML-RPC types mapped to JSON types), and returned to the consumer as clean JSON. Faults are mapped to appropriate HTTP error responses.
Your XML-RPC server stays untouched. Keep your existing methods and endpoint. The handler handles all XML construction and parsing — consumers never see XML.
Demo API: US Congress and Presidents
This demo uses a US Congress and Presidents dataset — 12,790 officials from 1789 to the present day. Every member of the Senate and House of Representatives, every President and Vice President, with biographical data, party affiliation, state, term dates, and committee assignments. Methods include lookups by name, state, party, chamber, term year, and full-text search.
Code Example
Look up a president by name
# XML-RPC methodCall to look up a historical official
curl http://localhost:4006/xmlrpc \
-H "Content-Type: text/xml" \
-d '<?xml version="1.0"?>
<methodCall>
<methodName>getOfficialByName</methodName>
<params>
<param>
<value><string>Abraham Lincoln</string></value>
</param>
</params>
</methodCall>'Response (XML)
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>name</name>
<value><string>Abraham Lincoln</string></value>
</member>
<member>
<name>role</name>
<value><string>President</string></value>
</member>
<member>
<name>party</name>
<value><string>Republican</string></value>
</member>
<member>
<name>state</name>
<value><string>Illinois</string></value>
</member>
<member>
<name>termStart</name>
<value><string>1861-03-04</string></value>
</member>
<member>
<name>termEnd</name>
<value><string>1865-04-15</string></value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>Through the Opsalis handler, the same call becomes simple JSON:
Same call via the Opsalis handler (JSON)
# Consumer sends JSON — handler builds the XML-RPC methodCall
curl http://localhost:3000/api/congress/getOfficialByName \
-H "Content-Type: application/json" \
-d '{ "name": "Abraham Lincoln" }'XML-RPC Type Mapping
XML-RPC defines a small set of data types. The handler automatically converts between these and their JSON equivalents:
| XML-RPC Type | JSON Equivalent | Example |
|---|---|---|
<string> |
string | "hello" |
<int> / <i4> |
number | 42 |
<double> |
number | 3.14 |
<boolean> |
boolean | true |
<dateTime.iso8601> |
string (ISO 8601) | "2026-03-01T12:00:00Z" |
<base64> |
string (base64) | "SGVsbG8=" |
<array> |
array | [1, 2, 3] |
<struct> |
object | { "key": "value" } |
XML-RPC at a Glance
| Concept | Details |
|---|---|
| Transport | HTTP POST |
| Data format | XML |
| Spec format | Method list (no formal IDL; introspection via system.listMethods) |
| Request structure | <methodCall> with <methodName> and <params> |
| Error handling | <fault> with faultCode and faultString |
| Best for | Legacy systems, CMS platforms, embedded devices, WordPress integrations |