[MOBY-guts] biomoby commit

José Manuel Rodríguez Carrasco jmrc at dev.open-bio.org
Mon Jun 30 10:31:27 UTC 2008


jmrc
Mon Jun 30 06:31:26 EDT 2008
Update of /home/repository/moby/moby-live/Docs/asyncDocs/async-MOBY-test
In directory dev.open-bio.org:/tmp/cvs-serv8645

Modified Files:
	AsyncService.pm 
Log Message:
user: jmrc
date: 30-June-2008

Fixing one little bug in the async service test.
The outputs of this service were wrong. The service does not
have to keep in mind the input "queryId's".




moby-live/Docs/asyncDocs/async-MOBY-test AsyncService.pm,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Docs/asyncDocs/async-MOBY-test/AsyncService.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Docs/asyncDocs/async-MOBY-test/AsyncService.pm	2008/04/23 13:08:10	1.2
+++ /home/repository/moby/moby-live/Docs/asyncDocs/async-MOBY-test/AsyncService.pm	2008/06/30 10:31:26	1.3
@@ -4,28 +4,31 @@
 use MOBY::CommonSubs qw(:all); 
 use MOBY::Async::SimpleServer;
 use vars qw(@ISA);
-use base qw(MOBY::Async::SimpleServer);
+ at ISA = qw(MOBY::Async::SimpleServer);
 
 # This variable is a subroutine which carry out the core of the service
-my $sayHello = sub {
-   my ( $caller, $MOBY_message ) = @_;
-
-
-     # ...
-     # The code of your service
-     # ...
-   sleep(10);
-   my $serviceRequest = <<END;
-	<moby:mobyData queryID="1">
-        	<moby:Simple moby:articleName="output">
-			<moby:Object id="" namespace="" articleName="" /> 
+my $sayHello = sub
+{
+	my ( $caller, $MOBY_message ) = @_;
+
+	# ...
+	# The code of your service
+	# ...
+	my $serviceRequest = '';
+	my $MOBYDatainputs = MOBY::CommonSubs::serviceInputParser( $MOBY_message );
+	foreach my $queryID ( keys %{$MOBYDatainputs} )
+	{
+		$serviceRequest .= "
+	<moby:mobyData queryID='$queryID'>
+		<moby:Simple articleName='output'>
+			<moby:Object id='None' namespace='None' articleName='async-test' />
 		</moby:Simple>
-	</moby:mobyData>
-END
+	</moby:mobyData>";
+	}
+	sleep(180);
 
-    return SOAP::Data->type('string' => (MOBY::CommonSubs::responseHeader('cnio.es') . $serviceRequest . MOBY::CommonSubs::responseFooter()));
+	return SOAP::Data->type('string' => (MOBY::CommonSubs::responseHeader('cnio.es') . $serviceRequest . MOBY::CommonSubs::responseFooter()));
 
-#      return $serviceRequest;
 };
 
 # This is the method that answers to synchronous requests
@@ -36,21 +39,6 @@
     # Here you can choose between sync or error
     #return $self->sync($sayHello, 180, @_);
     return $self->error(@_);
-   
-#    my $serviceRequest = <<END;
-#<moby:MOBY moby:smessageVersion='0.88' xmlns:moby='http://www.biomoby.org/moby' xmlns='http://www.biomoby.org/moby'>
-#<moby:mobyContent moby:authority='cnio.es'>
-#        <moby:mobyData queryID="1">
-#                <moby:Simple moby:articleName="output">
-#                        <moby:Object id="" namespace="" articleName="" />
-#                </moby:Simple>
-#        </moby:mobyData>
-#</moby:mobyContent>
-#</moby:MOBY>
-#END
-
-# return $serviceRequest;
-
 }
 
 # This is the method that answers to asynchronous requests
@@ -59,41 +47,5 @@
      return $self->async($sayHello, @_);
 }
 
-#--------------------------------------
-#
-# my $sayGoodbye = sub {
-#    my ( $caller, $MOBY_message ) = @_;
-# 
-#      sleep(10);
-#      my $serviceRequest = <<END;
-# <moby:mobyData queryID="1" xmlns:moby='http://biomoby.org/moby'>
-# 	<moby:Simple moby:articleName="output">
-# 		<moby:Object id="" namespace="" articleName="" />
-# 	</moby:Simple>
-# </moby:mobyData>
-# END
-# 
-#      #return SOAP::Data->type('string' => (MOBY::CommonSubs::responseHeader('cnio.es') . $serviceRequest . MOBY::CommonSubs::responseFooter()));
-#      return $serviceRequest;
-# };
-     
-# This is the method that answers to synchronous requests
-#sub sayGoodbye {
-#     my ( $caller, $MOBY_message ) = @_;
-#
-#     # Here you can choose between sync or error
-#     #return $self->sync($sayGoodbye, 180, @_);
-#     return $self->error(@_);
-#     
-#}
-
-# This is the method that answers to asynchronous requests
-# sub sayGoodbye_submit {
-#     my $self = shift @_;
-# 
-#     return $self->async($sayHello, @_);
-# 
-# }
-
 1;
-                                                                         
+




More information about the MOBY-guts mailing list