[MOBY-l] The original thread returns... Re: Interpreting results from Service->execute()

Mark Wilkinson markw at illuminae.com
Thu Mar 18 15:33:23 UTC 2004


Frank!  Sorry, I was totally braindead when I responded to this message
a few days ago.  I apologize - multitasking is obviously getting the
better of me!

So, the *correct* answer to this question is that we have no *formal*
way for the server to report errors to you, but we do have an *informal*
way for this to happen.

In the moby:Response XML block there is a serviceNotes element:

      <?xml version="1.0" encoding="UTF-8"?>
      <moby:MOBY xmlns:moby="http://www.biomoby.org/moby">
        <moby:Response moby:authority="http://tempcalculator.org/tempcalculator"> 
          <moby:serviceNotes>freetext notes here</moby:serviceNotes>
          <moby:queryResponse queryID=''>
                <!-- articles (Simple/Collection/Secondary) returned from the service in response to a single queryInput block -->
          </moby:queryResponse>
          [<moby:queryResponse queryID=''>
                <!-- articles (Simple/Collection/Secondary) returned from the service in response to a single queryInput block -->
          </moby:queryResponse>]
          ...
          ...
        </moby:Response>
      </moby:MOBY>

and that should be used by the service provider to pass you free-text descriptions
of what may have gone wrong server-side with your query (or any other unstructured
notes that the service provider may wish to send you, even if the service executed
successfully!)

So far, nobody I know is using that (probably because I have not written the
API's to do so ;-) ), and the existing clients would ignore it anyway... but 
it is there for that purpose!  There are actually several bits of the MOBY-S 
API that have not yet been "instantiated" at the code level... this is one of 
them.

I'll try to get this done today, since Heiko just wrote me that he needs it
up and running right away as well.

Anyway, that is the *correct* answer to your question.  Sorry for that - I was
thinking in terms of an error "object" rather than a free-text note, so it just
never tweaked in my head that we had an element for that purpose, and I misled
you with my initial response.

Mark


On Tue, 2004-03-16 at 15:07, Frank Gibbons wrote:
> Hi MOBYers,
> 
> I've been playing with MOBY all day (installed Perl 5.8.3 just for this!), 
> and find that it works pretty well. I've successfully called 
> plantspGetProtein from sdsc.edu and GetPubmed from prometheus.brc.mcw.edu.
> 
> Now I'm trying to call getInteractingMethods from pdg.cnb.uam.es, and 
> although it returns something, I just don't understand what it returns. The 
> code I'm using to call it is appended at the end of this (having been 
> cribbed from
> Catherine Letondal and Ken Streube - thanks to both for great tutorials!), 
> but the important part is this:
> 
>     my $pid = "EBI-141";
>     my $result =
>        $service->execute( XMLinputlist => [
>                                            ["object$i",
>                                             "<Object namespace='IntAct' 
> id='$pid'/>"]
>                                           ] ) || 'None';
> 
> Response is:
> 
> <?xml version='1.0' encoding='UTF-8'?>
>        <moby:MOBY xmlns:moby='http://www.biomoby.org/moby'
> xmlns='http://www.biomoby.org/moby'>
>          <moby:Response moby:authority='pdg.cnb.uam.es'>
>          <moby:queryResponse queryID='1'/>
>      </moby:Response>
>        </moby:MOBY>
> 
> Now I'm not XML expert, but it's certainly not gibberish, or an error 
> condition. I'm fairly sure the accession number I'm using is correct (it 
> works when I go to IntAct's webpage): if it's not correct, shouldn't the 
> service let me know somehow ("ID not found"). And if it is correct, where's 
> my information? If the id is correct, but there are in fact no interacting 
> methods, shouldn't it say "There are no interacting methods"? Instead it 
> seems to just be acknowledging my request, but not providing any new 
> information.
> 
> I'll be the first to admit ignorance of XML, SOAP, etc. If this is a really 
> dumb question, I'll be happy to read whatever you guys suggest. But I'm 
> really hoping there's a simpler answer
> 
> Thanks (in advance),
> 
> -Frank Gibbons
> 
> ========================= appended code here =========================
> #!/home/fgibbons/bin/perl
> 
> use MOBY::Client::Central;
> use MOBY::Client::Service;
> use strict;
> my $Central = MOBY::Client::Central->new();
> 
> my ($Services, $REG) =
> #                        );
> #  $Central->findService( authURI => 'prometheus.brc.mcw.edu',
> #                        serviceName => 'GetPubmed'
> 
>    $Central->findService( authURI => 'pdg.cnb.uam.es',
>                           serviceName => 'getInteractingMethods'
>                         );
> unless ($Services) {
>      print "Service discovery failed with the following errror: ",
>        $REG->message;
>      exit(0);
>    }
> 
> my @PIDs = ('1BIJ', '4HHB');
> my @IntActIDs = ('EBI-141');
> printf("%-35s\t\t %s\n%s\n", "Service", "provided by", "="x80);
> foreach my $S ( #sort {
>                 #$a->authority cmp $b->authority or
>                 #$a->name cmp $b->name }
>                 @{$Services}) {
>    printf("%-35s\t\t%s%s\n", $S->name, $S->authority, $S->description);
>    my $WSDL = $Central->retrieveService($S);
>    my $service = MOBY::Client::Service->new(service => $WSDL);
>    my $i = 0;
>    foreach my $pid (@IntActIDs) {
>      my $result =
>        $service->execute( XMLinputlist => [
>                                            ["object$i",
>                                             "<Object namespace='IntAct' 
> id='$pid'/>"]
>                                           ] ) || 'None';
>      print "Result ($i): $result\n";
>      $i++;
>    }
> }
> 
> 
> 
> PhD, Computational Biologist,
> Harvard Medical School BCMP/SGM-322, 250 Longwood Ave, Boston MA 02115, USA.
> Tel: 617-432-3555       Fax: 
> 617-432-3557       http://llama.med.harvard.edu/~fgibbons
> 
> _______________________________________________
> moby-l mailing list
> moby-l at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-l
-- 
Mark Wilkinson (mwilkinson at mrl.ubc.ca)
University of British Columbia iCAPTURE Centre



More information about the moby-l mailing list