Registering your service

To register the service getGoTerm that you created at the end of Constructing Your Service you would use the following code:

use MOBY::Client::Central;
my $m = MOBY::Client::Central->new;

#NOTE: the service Name MUST be identical to the name you
# called it in the Dispatcher
# and identical to the name of the subroutine itself.
my $serviceName = "getGoTerm";


# this is a term taken from the MOBY Service Ontology
# that most closely reflects the nature of what your service does
my $serviceType = "Retrieval";


# this is a unique string in the form nnn.nnn.nnn that
# identifies you as a particular service provider.  Your
# domain name (excluding http://) is most useful
my $authURI = "mydomain.mycompany.org";


# this is the URL where your Dispatcher is located
my $URL = "http://mydomain.mycompany.org/cgi-bin/MOBY/Dispatcher.cgi";


# finally, you want to make a nice human-readable description for
# your service.  This should include things like what organism your
# database provides information about, or what data or algorithm you
# use.  Things that might help people find you based on a keyword search
my $description = "This service consumes GO ID's and returns GO Terms and definitions";


# now start constructing the descriptions of your inputs and outputs:

   # a list of valid input namespaces
my @input_namespaces = ('GO');  
   # a list of inputs and their namespaces, in this case, a single input 'Object'
my @input_simples = ('Object', \@input_namespaces); 
   # note:  if you alternately wanted to consume a collection of inputs as opposed
   # to a simple input, you would have done the following:
   # my @input_simples = (['Object', \@input_namespaces)]); 
   # a list of named input articles
my @input_articles = ('my_input_parametername', \@input_simples);   
   # the complete set of inputs to a single invocation of the service
my @all_inputs = (\@input_articles); 


   # a list of valid input namespaces
my @output_namespaces = ('GO');  
   # a list of outputs and their namespaces, in this case, a single output type 'GO_Term'
my @output_simples = ('GO_Term', \@output_namespaces); 
   # a list of (un)named output articles
my @output_articles = ('my_output_parametername', \@output_simples);   
   # the complete set of outputs from a single invocation of the service
my @all_outputs = (\@output_articles);  

$REG = $m->registerService(
     serviceName  => $serviceName,
     serviceType  => $serviceType,
     authURI      => $authURI,
     contactEmail => "your@mail.address",
     description => $description,
     category  =>  "moby" 
     URL    =>  $URL_TO_SERVICE
     input => \@all_inputs,
     output =>\@all_outputs,
     );

$REG->success?print "Success!\n":print "Failure: ",$REG->message,"\n";