[MOBY-guts] biomoby commit

Paul Gordon gordonp at pub.open-bio.org
Fri Jul 22 20:59:05 UTC 2005


gordonp
Fri Jul 22 16:59:05 EDT 2005
Update of /home/repository/moby/moby-live/Java/src/Clients
In directory pub.open-bio.org:/tmp/cvs-serv1828/src/Clients

Modified Files:
	TestRequest.java 
Log Message:
Upated to work with new data instance version

moby-live/Java/src/Clients TestRequest.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/Clients/TestRequest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/Clients/TestRequest.java	2005/05/12 05:22:27	1.1
+++ /home/repository/moby/moby-live/Java/src/Clients/TestRequest.java	2005/07/22 20:59:05	1.2
@@ -10,9 +10,7 @@
 import org.biomoby.client.MobyRequest;
 import org.biomoby.shared.Central;
 import org.biomoby.shared.MobyService;
-import org.biomoby.shared.data.MobyDataInstance;
-import org.biomoby.shared.data.MobyDataObject;
-import org.biomoby.shared.data.MobyDataObjectSet;
+import org.biomoby.shared.data.*;
 import java.util.Iterator;
 import java.util.Vector;
 
@@ -57,27 +55,18 @@
 	    mr.setDebugMode(true);
 	    mr.setService(validServices[0]);
 	    mr.setInput(input);  // use convenient anonymous single arg service parameterization
-	    java.util.Vector output = mr.invokeService();
-           
-	    String c = "";
-	    Iterator responses = output.iterator();
+	    MobyContentInstance responses = mr.invokeService();
 
 	    // Process responses
 	    // The service invocation may have had many requests, there is a response
 	    // object for each request
-	    while(responses.hasNext()){
-		
-		Object o = responses.next();
-		System.err.println("responses vector slot is a " + o.getClass().getName());
-		if(o instanceof Object[]){
-		    System.err.println("responses vector slot is an array");
-		}
-		MobyDataInstance[] responseObjects = (MobyDataInstance[]) o;
+	    Iterator i = responses.keySet().iterator();
+	    while(i.hasNext()){
+                Vector responseObjects = (Vector) responses.get(i.next());
 		
 		// The response for a request may have many objects
-		for(int k = 0; k < responseObjects.length; k++){
-		    //MobyDataInstance responseObject = responseObjects[k];
-		    Object responseObject = responseObjects[k];
+		for(int k = 0; k < responseObjects.size(); k++){
+		    Object responseObject = responseObjects.elementAt(k);
 		    // The response objects may either be simple data, or data sets
 		    if(responseObject instanceof MobyDataObject){
 			System.out.println("Plain simple instance is "+((MobyDataInstance)responseObject).toXML());




More information about the MOBY-guts mailing list