AboutBlogContact
Backend EngineeringFebruary 14, 2001 2 min read 112Updated: May 18, 2026

XML-RPC: Bridging the Gap Between Perl and Java (2001)

AunimedaAunimeda
📋 Table of Contents

XML-RPC: Bridging the Gap Between Perl and Java

In the early months of 2001, the "Interoperability" dream is finally coming true. We're moving away from proprietary binary protocols like DCOM or CORBA. Instead, we're using the "Universal Language" of the web: XML over HTTP. While some are pushing for the complex SOAP specification, many of us are sticking with the elegant simplicity of XML-RPC.

The Concept

XML-RPC allows you to call a function on a remote server as if it were local. The request is an XML document sent via HTTP POST, and the response is also XML.

The Java Server (using Apache XML-RPC)

On the server side, we can expose a simple Java class to the world.

public class Calculator {
    public int add(int i1, int i2) {
        return i1 + i2;
    }
}

// In your Servlet or Main class:
XmlRpcServer xmlrpc = new XmlRpcServer();
xmlrpc.addHandler("math", new Calculator());

The Perl Client (using Frontier::Client)

Perl is still the "glue of the internet," and its XML-RPC support is excellent.

use Frontier::Client;

my $server = Frontier::Client->new(url => 'http://java-server.example.com/RPC2');

my $result = $server->call('math.add', 5, 10);

print "The sum is: $result\n";

Under the Hood: The XML Payload

What’s actually going over the wire? It’s a readable (though verbose) XML document:

<?xml version="1.0"?>
<methodCall>
  <methodName>math.add</methodName>
  <params>
    <param><value><int>5</int></value></param>
    <param><value><int>10</int></value></param>
  </params>
</methodCall>

Why XML-RPC?

Unlike the heavy-weight enterprise solutions, XML-RPC has a tiny specification (it fits on one page!). It supports basic data types: strings, integers, booleans, dates, and even base64 for binary data. It doesn't have the overhead of WSDLs or complex namespaces. In a world where we're just trying to get different systems to share a bit of data, XML-RPC is a breath of fresh air.


Aunimeda builds production-grade backend systems - APIs, microservices, real-time applications, and system integrations.

Contact us for backend engineering services. See also: Custom Software Development, Web Development

Read Also

Spring Framework: Dependency Injection for the Massesaunimeda
Backend Engineering

Spring Framework: Dependency Injection for the Masses

Is the era of heavyweight EJB over? Rod Johnson’s Spring Framework offers a 'lightweight' alternative that promises to make Java Enterprise development fun again.

Beyond Regular: Recursive Regex in Perl 5.6 (2000)aunimeda
Backend Engineering

Beyond Regular: Recursive Regex in Perl 5.6 (2000)

They said it couldn't be done with a regular expression. They were wrong. Learn how to use (?R) to parse nested structures in Perl 5.6.

Distributed Java: Serialization and RMI Stubs (1999)aunimeda
Backend Engineering

Distributed Java: Serialization and RMI Stubs (1999)

JDK 1.2 is here, and RMI is finally stable. Learn how to invoke methods on remote Java objects as if they were local.

Need IT development for your business?

We build websites, mobile apps and AI solutions. Free consultation.

Get Consultation All articles