[Zope-Perl] more disruption
Michel Pelletier
michel@digicool.com
Mon, 16 Oct 2000 17:05:16 -0700
Ok, I'm getting close to my goals, got everything running. Thanks
Gisle.
Follows is a section from the book, I'm wondering if someone can help me
fill in the ???.
Extra special bonus points go to anyone who can solve the Java one too.
;)
-Michel
Here's a fanciful example that shows you how to remotely script
a mass firing of janitors using XML-RPC.
Here's the code in Python::
import xmlrpclib
server = xmlrpclib.Server('http://www.zopezoo.org/')
for employeeID in server.JanitorialDepartment.personnel():
server.fireEmployee(employee)
In Perl::
use Frontier::Client;
$server = Frontier::Client->new(url => $url);
???
In Java::
try
{
RPCClient rpc = new RPCClient();
rpc.setServer("betty.userland.com");
rpc.setPort(80);
rpc.setProcedureName("JanitorialDepartment.personnel");
Array employeeIds = (Array) rpc.executeRPC();
}
catch (RPCException ex)
{
ex.printStackTrace();
}