[MOBY-guts] biomoby commit

Paul Gordon gordonp at pub.open-bio.org
Thu May 6 03:23:03 UTC 2004


gordonp
Wed May  5 23:23:02 EDT 2004
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/client
In directory pub.open-bio.org:/tmp/cvs-serv24153/Java/src/main/org/biomoby/client

Modified Files:
	MobyRequest.java 
Log Message:
Updated to use new mobyContent/mobyData structure of 0.7 API

moby-live/Java/src/main/org/biomoby/client MobyRequest.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java	2004/04/21 17:28:58	1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/client/MobyRequest.java	2004/05/06 03:23:02	1.2
@@ -102,7 +102,7 @@
 	// Now compile the XPath statements that will be used fetch data from the server response
 	try{
 	    base64EncodedXPath = new XPath("//*[@xsi:type=\"SOAP-ENC:base64\"]", null, mobyPrefixResolver, XPath.SELECT);
-	    queryResponseXPath = new XPath("//moby:queryResponse | //queryResponse", null, mobyPrefixResolver, XPath.SELECT);
+	    queryResponseXPath = new XPath("//moby:mobyData | //mobyData", null, mobyPrefixResolver, XPath.SELECT);
 	    simpleChildXPath = new XPath("moby:Simple | Simple", null, mobyPrefixResolver, XPath.SELECT);
 	    collectionChildXPath = new XPath("moby:Collection | Collection", null, mobyPrefixResolver, XPath.SELECT);
 	}
@@ -428,8 +428,8 @@
 	// Start of envelope
 	String mobyRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
 	    "       <moby:MOBY xmlns:moby=\"" + MobyPrefixResolver.MOBY_XML_NAMESPACE + "\">\n" +
-	    "          <moby:Query>\n" +
-	    "<moby:queryInput moby:queryID='1'>";
+	    "          <moby:mobyContent>\n" +
+	    "<moby:mobyData moby:queryID='1'>";
 
 	// Real input data payload
 	if(data != null){
@@ -458,8 +458,8 @@
 	
 	// End of envelope
 	mobyRequest +=
-	    "              </moby:queryInput>\n" +
-	    "          </moby:Query>\n" +
+	    "              </moby:mobyData>\n" +
+	    "          </moby:mobyContent>\n" +
 	    "       </moby:MOBY>\n";
 	if(debug){
 	    debugPS.println("Input to MOBY Service is:");
@@ -483,17 +483,17 @@
 	try{
 	    response_list = runXPath(queryResponseXPath, n);
      	}catch(TransformerException te){
-            throw new MobyException("Cannot select MOBY DOM queryResponse nodes due to exception "+
+            throw new MobyException("Cannot select MOBY DOM mobyContent nodes due to exception "+
 				    "while executing XPath statement: " +te);
 	}
 	
 	if(response_list == null || response_list.getLength() == 0){
-	    throw new MobyException("Could not find any queryResponse elements in the output");
+	    throw new MobyException("Could not find any mobyContent elements in the output");
 	}
 	if(debug){
-	    debugPS.println("Aha! Got " + response_list.getLength() + " queryResponses");
+	    debugPS.println("Aha! Got " + response_list.getLength() + " mobyContent response elements");
 	}
-	// Do data deserialization for each queryResponse
+	// Do data deserialization for each response's mobyData
 	for(int i = 0; i < response_list.getLength(); i++){
 	    Node response = response_list.item(i);
 	    debugPS.println("Got response " + response);
@@ -504,7 +504,7 @@
 	    try{
 		collections = runXPath(collectionChildXPath, response);
 	    }catch(TransformerException te){
-		throw new MobyException("Cannot select MOBY DOM queryResponse/Collection nodes due to exception "+
+		throw new MobyException("Cannot select MOBY DOM mobyData/Collection nodes due to exception "+
 					"while executing XPath statement: " +te);
 	    }
 	    for(int j = 0; collections != null && j < collections.getLength(); j++){
@@ -517,7 +517,7 @@
 		NodeList subsimples = null;
 		try{subsimples = runXPath(simpleChildXPath, collections.item(j));}
 		catch(TransformerException te){
-		    throw new MobyException("Cannot select MOBY DOM queryResponse/Collection/Simple " +
+		    throw new MobyException("Cannot select MOBY DOM mobyData/Collection/Simple " +
 					    "nodes due to exception "+
 					    "while executing XPath statement: " +te);
 		}
@@ -542,12 +542,12 @@
 	    try{
 		simples = runXPath(simpleChildXPath, response);
 	    }catch(TransformerException te){
-		throw new MobyException("Cannot select MOBY DOM queryResponse/Collection nodes due to exception "+
+		throw new MobyException("Cannot select MOBY DOM mobyData/Collection nodes due to exception "+
 					"while executing XPath statement: " +te);
 	    }
 	    if((collections == null || collections.getLength() == 0) &&
 	       (simples == null || simples.getLength() == 0)){
-		debugPS.println("WARNING: There appears to be no output data in queryResponse #" + i);
+		debugPS.println("WARNING: There appears to be no output data in mobyData #" + i);
 	    }
 	    for(int j = 0; simples != null && j < simples.getLength(); j++){
 		if(debug && j == 0)




More information about the MOBY-guts mailing list