[MOBY-l] Services accepting multiple inputs
Andreas Groscurth
groscurt at mpiz-koeln.mpg.de
Thu Apr 3 08:47:56 UTC 2008
Hi Ola,
when i understand it correctly you want to call a service which takes
one input for several inputs and expect MobyRequest to handle those
several inputs. For me this approach does not make any sense and
MobyRequest works correct as it is... it calls a service and returns it
result.
If you want to call the same service more often with different inputs
you have to call the service more often and not giving the request all
inputs...
MobyService templateService = new MobyService("MOBYSHoundGetGenBankff");
MobyService[] validServices = worker.findService(templateService);
MobyRequest mr = new MobyRequest(worker);
mr.setService(validServices[0]);
// simple example of iterating over all inputs
for(String[] input : inputs) {
mr.setInput(new MobyDataObject(input[0], input[1]);
mr.setInput(input);
mr.invokeService(this);
}
what do you expect to get back in your case ? it would mean you have a
number of xmls, one for each input you give... how to know which input
returned which output ?
maybe there is a way, as Mark apparently indicates, but i cant see how
shall work....
best
andreas
Ola Spjuth wrote:
> Hi Eddie,
>
> Thanks for the snippet. As the MobyRequest acceps a MobyDataInstance[]
> I thought this would be handled by the MobyRequest but reading the
> source reveals that in this case if too many inputs, only one will be
> used . Anyway, what does a service respond with if it accepts multiple
> inputs, for example a list of objects with undefined size? And could
> you please show how I pass in mutliple MobyData objects, as Mark
> described it, in the same MobyRequest invocation? Instead of doing as
> below (which obviously was wrong).
>
> MobyService templateService = new
> MobyService("MOBYSHoundGetGenBankff");
> MobyService[] validServices = worker.findService(templateService);
> MobyRequest mr = new MobyRequest(worker);
> mr.setService(validServices[0]);
>
> MobyDataObject[] input=new MobyDataObject[2];
> input[0]=new MobyDataObject("NCBI_gi", "111076");
> input[1]=new MobyDataObject("NCBI_gi", "111077");
>
> mr.setInput(input);
> mr.invokeService(this);
>
> Cheers,
>
> .../Ola
>
> On Apr 2, 2008, at 17:31 , Edward Kawas wrote:
>
>> Hi Ola,
>>
>> If you do a findService on the service that you would like to invoke,
>> then
>> you can see how many inputs there are.
>>
>> For instance (something like the following),
>>
>> CentralImpl central = new CentralImpl();
>> MobyService service = central.findService(new
>> MobyService("MOBYSHoundGetGenBankff"))[0];
>> // get the input count
>> int count = Service.getPrimaryInputs().length;
>>
>> Eddie
>>
>> -----Original Message-----
>> From: moby-l-bounces at lists.open-bio.org
>> [mailto:moby-l-bounces at lists.open-bio.org] On Behalf Of Ola Spjuth
>> Sent: April-02-08 8:06 AM
>> To: moby-l at lists.open-bio.org
>> Subject: [MOBY-l] Services accepting multiple inputs
>>
>> Hi,
>>
>> Is there a way to see if services accept multiple inputs? I tried to
>> feed the "MOBYSHoundGetGenBankff" with a MobyDataObject[] containing
>> two simple objects with id and namespace. The result (as far as I can
>> see) was only one 'file', and the other input object seems to have
>> been omitted. Have I done something wrong or does this service only
>> accept a single input? In that case, how can this be deducted from
>> the service in jMoby?
>>
>> Cheers,
>>
>> .../Ola
>> _______________________________________________
>> moby-l mailing list
>> moby-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/moby-l
>>
>
> _______________________________________________
> moby-l mailing list
> moby-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/moby-l
More information about the moby-l
mailing list