|
P5EEx-Blue-0.01 | |||||||
| PREV NEXT | FRAMES NO FRAMES | |||||||
![]() |
Repository::SOAP remote source by making a SOAP call |
Repository::SOAP - a repository implementation which actually gets data from a remote source by making a SOAP (simple object access protocol) call
use Repository::SOAP;
(see man page for Repository::Base for additional methods)
################################################################### # constructors ###################################################################
$rep = Repository::SOAP->new();
################################################################### # methods not defined in the Repository::Base interface ###################################################################
# ...
################################################################### # defined in the Repository::Base interface, implemented here ###################################################################
$ok = $rep->connect(); # initialize repository (will happen automatically in constructor)
$ok = $rep->disconnect(); # cleanup repository (will happen automatically in destructor)
$rep->is_connected(); # returns 1 if connected (ready for use), 0 if not
$errmsg = $rep->error(); # returns the error string for prev op ("" if no error)
$numrows = $rep->numrows(); # returns the number of rows affected by prev op
print $rep->error(), "\n" if (!$rep->connect());
print $rep->error(), "\n" if ($rep->connect() != $rep->OK);
# META-DATA: (about the tables) $rep->load_rep_metadata_init(); $rep->load_table_metadata_init($tablename);
# MEDIUM-LEVEL: reads and writes rows, no caching $row = $rep->select_row ($table, \@cols, \@wherecols, \%wherevalues); $rows = $rep->select_rows($table, \@cols, \@wherecols, \%wherevalues, \@ordercols, $startrow, $endrow); $ok = $rep->insert_row ($table, \@cols, \@colvalues); $ok = $rep->insert_rows($table, \@cols, \@rows); $ok = $rep->update_row ($table, \@cols, \@colvalues, \@keycolidx); $ok = $rep->update_rows($table, \@cols, \@colvalues, \@wherecols, \%wherevalues); $ok = $rep->store_row ($table, \@cols, \@colvalues, \@keycolidx, $update_first); $ok = $rep->store_rows ($table, \@cols, \@rows, \@keycolidx, $update_first); $ok = $rep->delete_row ($table, \@cols, \@colvalues, \@keycolidx); $ok = $rep->delete_rows($table, \@wherecols, \%wherevalues);
The Repository::SOAP class implements a logical repository which is actually an interface to a remote source of data. The local interface translates the parameters of the methods into XML and issues a SOAP (simple object access protocol) request to a remote machine to fulfill the method. Details of the actual SOAP request and the remote repository are controlled by the configuration information.