[MOBY-dev] call to a service in a service

Edward Kawas edward.kawas at gmail.com
Wed Aug 27 14:25:46 UTC 2008


Okay, the reason that I asked was to see whether or not you had access to
the classes: MobyPackage & MobyJob.

Here is how you could create the XML for sending to a service:

// get the following values somewhere
String id, ns = ...;
String result = ...; // the dnasequence that I retrieved

MobyPackage result = new MobyPackage()
MobyJob j = new MobyJob();
j.setId("myQueryId");
DNASequence output_data_type = new DNASequence();
output_data_type.setId(id);
output_data_type.setNamespace(ns);
output_data_type.set_content(result);
j.setData(output_data_type,"sequence");
result.addJob(j);

String xml = result.toXML(); // used below


Here is how you could call the service:

String endpoint = ""; // the url to the service
String service  = ""; // the service name
String serviceOutput = new
CentralImpl(endpoint,"http://biomoby.org/").call(service,xml)

Now, to parse the serviceOutput, you could use 
   MobyPackage.createFromXML(serviceOutput)

The import statements that you would need are 
  org.biomoby.client.CentralImpl, 
  org.biomoby.shared.datatypes.*, 
  org.biomoby.shared.parser.MobyJob, 
  org.biomoby.shared.parser.MobyPackage

Does this make sense? If you need any clarifications, let me know.

Eddie


-----Original Message-----
From: moby-dev-bounces at lists.open-bio.org
[mailto:moby-dev-bounces at lists.open-bio.org] On Behalf Of Pierre-Yves Chibon
Sent: August-27-08 7:04 AM
To: Core developer announcements
Subject: Re: [MOBY-dev] call to a service in a service

Edward Kawas wrote:
> Hi Pierre,
> 
> Are you using MoSeS?

Hi Edward,

Yes we used it to generate the skeleton but we need in the "processit" 
method to call two of our web service with an ID that the grab from the 
first part of the service.
Let me rephrase that:

User -> send an ID
Service1 -> get the request
	 -> perform a sql query
	 -> call service 2 and service3 with the results of this query (a 
different ID)
	 -> assemble results from service2 and 3
	 -> return data to the user.

NB
The object return by service2 and service3 are part of the objet 
returned by service1, we designed them in that purpose.

Thanks for the quick reply
Best regards,

Pierre
_______________________________________________
MOBY-dev mailing list
MOBY-dev at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/moby-dev




More information about the MOBY-dev mailing list