<?php
require_once "XML/RPC.php";
require_once "xmlrpc_util.php";
require_once "myconfig.cfg";
$c=new XML_RPC_Client(XMLRPC_URI, MDB_SERVER_NAME, MDB_SERVER_PORT);
$f=new XML_RPC_Message('system.listMethods');
$v=rpc_call($c, $f);
print "<h2>Methods available at http://" . $c->server . ":" .
$c->port . $c->path . "</h2>\n";
if ($v) {
for($i=0; $i<$v->arraysize(); $i++) {
$mname=$v->arraymem($i);
print "<hr noshade size=1><H3>" . $mname->scalarval() . "</H3>\n";
$f=new XML_RPC_Message('system.methodHelp');
$f->addParam(new XML_RPC_Value($mname->scalarval(), "string"));
$w=rpc_call($c, $f);
if ($w) {
$txt=$w->scalarval();
if ($txt!="") {
print "<H4>Documentation</H4><P style='font-size: 1.0em;'>${txt}</P>\n";
} else {
print "<P>No documentation available.</P>\n";
}
}
$f=new XML_RPC_Message('system.methodSignature');
$f->addParam(new XML_RPC_Value($mname->scalarval(), "string"));
$w=rpc_call($c, $f);
if ($w) {
print "<H4>Signature</H4><P style='font-size: 1.0em;'>\n";
if ($w->kindOf()=="array") {
for($j=0; $j<$w->arraysize(); $j++) {
$x=$w->arraymem($j);
$ret=$x->arraymem(0);
print "<CODE style='font-size: 1.0em;'>" . $ret->scalarval() . " " .
$mname->scalarval() ."(";
if ($x->arraysize()>1) {
for($k=1; $k<$x->arraysize(); $k++) {
$y=$x->arraymem($k);
print $y->scalarval();
if ($k<$x->arraysize()-1) {
print ", ";
}
}
}
print ")</CODE><BR>\n";
}
} else {
print "Signature unknown\n";
}
print "</P>\n";
}
}
}
?>
General function to query the MDB database server. Accepts a valid SQL query ("SELECT", "SHOW", or "DESCRIBE" statements only), and returns the resulting rows as a structure.
struct method.sql(string)
Specialized function to retrieve a list of PDB structures containing a particular metal ion, as indexed in the MDB. The retrieval mode can be one of "first" (default) to get the first "n" PDB ids (sorted alphabetically), "last" to get the last "n" ids, "random" to get "n" random entries, and "new" to ge the newest "n" entries released/indexed. The number of entries to retrieve is set using "count". The result can be returned as XML-RPC structure, WDDX packet or RSS document
struct method.metallopdb(string, string, int, string)
Returns the requested file. It accepts 2 parameters: the name of the file, and (optionally) the whether the base64 encoding will be done on the "raw" (default) file, or the file after being compressed with gzip ("gzip").
base64 method.get(string, string)
This method lists all the methods that the XML-RPC server knows how to dispatch
array system.listMethods(string)
array system.listMethods()
Returns help text if defined for the method passed, otherwise returns an empty string
string system.methodHelp(string)
Returns an array of known signatures (an array of arrays) for the method name passed. If no signatures are known, returns a none-array (test for type != array to detect missing signature)
array system.methodSignature(string)