[MOBY] [MOBY-l] Creating MOBY Service

Mark Wilkinson markw at illuminae.com
Sat Jul 19 13:17:16 UTC 2003


Hi Vijay, 

I'm afraid I have to (again) direct you to please read the
documentation.  The link that I sent you a few days ago takes you to a
page that describe the methodology for setting up services, and describe
how to use the MOBY::Client::Central interface to talk to these
services.  Neither your client code, nor your service code below, are
coded according to the instructions on this page, yet the examples in
that document are nearly cut-n-paste functional, so I can only assume
that you didn't read them.

Secondly, I think you will find it easier to test your services by using
the command-line versus using the CGI Client program.  The CGI client
masks most errors because it is "production", so you will have a
terrible time trying to debug things without any error messages :-)

Here is a bit of code that I use to test my services from the
command-line (see the documentation for MOBY::Client::Central and
MOBY::Client::Service for more details):

use MOBY::Client::Central; 
use SOAP::Lite + trace;
use MOBY::Client::Service;
unless (defined $ARGV[0] && defined $ARGV[1]){ die "\a\a\n\nusage:

perl debug_moby_central.pl  MYauthURI  MYserviceName

"}


$m = MOBY::Client::Central->new; 
($sis, $fail) = $m->findService(authURI=>$ARGV[0],
serviceName=>$ARGV[1]);
 
$s = ${$sis}[0];   # MUST be only one, so take first
$wsdl = $m->retrieveService($s);  # get the interface def.
$S = MOBY::Client::Service->new(service => $wsdl); # create a connection
$result = $S->execute(XMLinputlist => [["", "<Object
namespace='Global_Keyword' id='Mark'>"]]);  # execute it with valid data
print $result;

Using this on your "HiService" service, Your service reports an internal
server error 500.  You should check your webserver error logs for more
details... but before anything you should *read the documentation* on
how to set up servers.

I would also discourage you from registering (or at least, leaving
registered) services that don't "do" anything.  The MOBY Central
registry you are using is a production server rather than a development
server, and is "live" and actively used, so if we can avoid cluttering
it with non-useful services that would be best.  I see you currently
have two such services registered there.  If I can find some free time I
will set up a public MOBY::Central specifically for the purpose of
testing (or you could follow the instructions on the biomoby website
regarding setting up a local instance of MOBY::Central), but for the
moment it would be best to register, try-out, and then deregister your
test services in the Production MOBY Central registry.

More than anything, I would strongly suggest that you read the
documentation before starting - the MOBY::* code documentation
(available by clicking the Perl Links on the left side of the main
page), and the MOBY API (also available by clicking 0.5 API on the left
side of the main page), and the links to "Where Do I Start" that I sent
you a few days ago.  In there are explicit, working examples of clients,
service "listeners", and services.  Cut and paste from these examples,
test your services from the command line, check your server logs for
details of errors, clean up after yourself, and let us know how things
go.

Keep trying :-)  It really isn't difficult once you have written the
first one.

Cheers!

Mark


On Fri, 2003-07-18 at 13:34, Vijay Narayanasamy wrote:
> Hi all,
> 
>  
> 
> I'm a new to BioMOBY. I tried to register a service that takes an
> Object 'Global_Keyword' as the input and returns String
> 'Global_Keyword' as the output.  I tested my Service (cgi) locally
> using a perl client and it works fine.
> 
>  
> 
> For example the output is "Welcome to BioMOBY Vijay" for the input
> "Vijay" 
> 
>  
> 
> I registered this service with MOBY. The service got registered but
> when I send the Input object to my service. I got "Service
> Unavailable" message. 
> 
>  
> 
> What is the mistake that I'm be doing? 
> 
>  
> 
>  
> 
> The following is the source code (If I failed to explain correctly).
> All the files are in my cgi-bin directory.
> 
>  
> 
> hibye.pl (The client I used to test my service)
> 
> -------------------------------------------------------------------
> 
> #!/usr/local/bin/perl -w
> 
> use SOAP::Lite;
> 
> my $name = shift;
> 
> print SOAP::Lite
> 
>    -> uri('http://prometheus.brc.mcw.edu/Demo')
> 
>    -> proxy('http://prometheus.brc.mcw.edu/vnarayan-bin/hibye.cgi')
> 
> ->welcome($name)
> 
>    -> result;
> 
>  
> 
>  
> 
> hibye.cgi (The Service)
> 
> --------------------------------
> 
>  
> 
> #!/usr/local/bin/perl -w
> 
> use SOAP::Transport::HTTP;
> 
> use Demo;
> 
> SOAP::Transport::HTTP::CGI
> 
>   -> dispatch_to('Demo')
> 
>   -> handle;
> 
>  
> 
> Demo.pm ( The modules that has the subroutine welcome)
> 
> ---------------------------------------------------------------------------------
> 
> #!/usr/local/bin/perl -w
> 
>  
> 
> package Demo;
> 
>  
> 
> sub welcome{
> 
>   shift;                                      # remove class name
> 
>   return "Welcome to BioMOBY" ." ". shift;
> 
> }
> 
>  
> 
> 1;
> 
>  
> 
>  
> 
> RegisterService.pl (The code that I used to register my service)
> 
> -----------------------------------------------------------------------------------------------
> 
> #!/usr/local/bin/perl -w
> 
> use MOBY::Client::Central;
> 
>  
> 
> my $C = MOBY::Client::Central->new();
> 
>  
> 
> $C->registerService(
> 
>     serviceName  => "HiService", 
> 
>     serviceType  => "Retrieval",  
> 
>     authURI      => "http://prometheus.brc.mcw.edu",      
> 
>     contactEmail => 'vnarayan at mail.brc.mcw.edu',      
> 
>     description => "Vj's test service that welcomes you to BIOMOBY.
> Enter your first name", 
> 
>     category  =>  "moby",
> 
>     URL    =>  "http://prometheus.brc.mcw.edu/vnarayan-bin/hibye.pl",
> 
>             input =>[ ['asdf',[Object => ['Global_Keyword']]],], #
> Simple
> 
>             output =>[['asdfg', [String => ['Global_Keyword']]],], #
> Simple
> 
>             );
> 
> exit 0;
> 
>  
> 
>  
> 
>  
> 
>  
> 
> Vijay Narayanasamy
> 
> Bioinformatics Research Center
> 
> Medical College of Wisconsin
> 
> 8701, W. Watertown Plank Road
> 
> Milwaukee, WI 53226
> 
> 414-491-3443
> 
>  
> 
> vnarayan at mail.brc.mcw.edu
> 
>  
> 
> 
> 
> ______________________________________________________________________
> _______________________________________________
> moby-l mailing list
> moby-l at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-l
-- 
Mark Wilkinson <markw at illuminae.com>
Illuminae




More information about the moby-l mailing list