<?php 
require_once "XML/RPC.php";
require_once 
"xmlrpc_util.php";
require_once 
"myconfig.cfg";

$c=new XML_RPC_Client(XMLRPC_URIMDB_SERVER_NAMEMDB_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";
  }
 }

}
?>

Output

Methods available at http://metallo.scripps.edu:80/services/xmlrpc.php


method.sql

Documentation

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.

Signature

struct method.sql(string)


method.metallopdb

Documentation

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

Signature

struct method.metallopdb(string, string, int, string)


method.get

Documentation

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").

Signature

base64 method.get(string, string)


system.listMethods

Documentation

This method lists all the methods that the XML-RPC server knows how to dispatch

Signature

array system.listMethods(string)
array system.listMethods()


system.methodHelp

Documentation

Returns help text if defined for the method passed, otherwise returns an empty string

Signature

string system.methodHelp(string)


system.methodSignature

Documentation

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)

Signature

array system.methodSignature(string)