[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Wed May 14 14:01:19 UTC 2008
kawas
Wed May 14 10:01:19 EDT 2008
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi
In directory dev.open-bio.org:/tmp/cvs-serv12207/Perl/MOBY-Server/share/cgi
Modified Files:
service_tester.pl
Log Message:
added code for testing category 'cgi' services
moby-live/Perl/MOBY-Server/share/cgi service_tester.pl,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/service_tester.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/service_tester.pl 2008/04/16 13:52:03 1.2
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/share/cgi/service_tester.pl 2008/05/14 14:01:19 1.3
@@ -35,6 +35,8 @@
use MOBY::Client::Central;
use SOAP::Lite;
use XML::LibXML;
+use HTTP::Request::Common qw(POST);
+use LWP::UserAgent;
# Because of this library, cannot run on windows
use IPC::Shareable;
@@ -116,28 +118,40 @@
} if $url =~ /localhost/;
# child - stuff to do goes here
+ my $out = undef;
+ my $input = _empty_input();
+
#print "Calling: " . $auth . "," . $name . "\n";
- my $soap =
- SOAP::Lite->uri("http://biomoby.org/")
- ->proxy( $url, timeout => $TIMEOUT )->on_fault(
- sub {
- my $soap = shift;
- my $res = shift;
-
- #TODO add to DEAD hash ...
- $alive_handle->shlock();
- $ALIVE{$auth} = () if not exists $ALIVE{$auth};
- push @{ $ALIVE{$auth} }, {name=>$name, alive=>undef};
- $alive_handle->shunlock();
+ do {
+ my $soap =
+ SOAP::Lite->uri("http://biomoby.org/")
+ ->proxy( $url, timeout => $TIMEOUT )->on_fault(
+ sub {
+ my $soap = shift;
+ my $res = shift;
+
+ #TODO add to DEAD hash ...
+ $alive_handle->shlock();
+ $ALIVE{$auth} = () if not exists $ALIVE{$auth};
+ push @{ $ALIVE{$auth} }, {name=>$name, alive=>undef};
+ $alive_handle->shunlock();
+
+ #print "\t" . $auth . "," . $name . " ~isAlive\n";
+ exit(0);
+ }
+ );
- #print "\t" . $auth . "," . $name . " ~isAlive\n";
- exit(0);
- }
- );
+ $out =
+ $soap->$name( SOAP::Data->type( 'string' => "$input" ) )->result;
+ } unless $cat eq 'cgi';
+ # test cgi services
+ do {
+ my $ua = LWP::UserAgent->new;
+ my $req = POST $opt_c, [ data => $input];
+ $req = $ua->request($req);
+ $out = $req->content if $req->is_success;
+ } if $cat eq 'cgi';
- my $input = _empty_input();
- my $out =
- $soap->$name( SOAP::Data->type( 'string' => "$input" ) )->result;
do {
#TODO add to ALIVE hash ...
#print "\t" . $auth . "," . $name . " isAlive\n";
More information about the MOBY-guts
mailing list