diff soap.cpp @ 334:100cf66a5825

Added command-line and WS methods to (LI)st key-(S)trings and si(Z)es of (T)racks --LISZT --lisztOffset offset --lisztLength len
author mas01mc
date Tue, 02 Sep 2008 16:16:59 +0000
parents cc3f9d1ca2cd
children cdb31e8b94e3
line wrap: on
line diff
--- a/soap.cpp	Mon Sep 01 15:35:05 2008 +0000
+++ b/soap.cpp	Tue Sep 02 16:16:59 2008 +0000
@@ -28,6 +28,21 @@
   soap_done(&soap);
 }
 
+void audioDB::ws_liszt(const char* dbName, char* Hostport){
+  struct soap soap;
+  adb__lisztResponse adbLisztResponse;
+
+  soap_init(&soap);
+  if(soap_call_adb__liszt(&soap, hostport, NULL, (char*)dbName, lisztOffset, lisztLength, adbLisztResponse)==SOAP_OK){
+    for(int i = 0; i < adbLisztResponse.result.__sizeRkey; i++) {
+      std::cout << "[" << i+lisztOffset << "] " << adbLisztResponse.result.Rkey[i] << " (" 
+		<< adbLisztResponse.result.Rlen[i] << ")" << std::endl;
+    }
+  } else {
+    soap_print_fault(&soap, stderr);
+  }
+}
+
 // WS_QUERY (CLIENT SIDE)
 void audioDB::ws_query(const char*dbName, const char *featureFileName, const char* hostport){
   struct soap soap;
@@ -138,7 +153,24 @@
     return SOAP_FAULT;
   }
 }
- 
+
+int adb__liszt(struct soap* soap, xsd__string dbName, xsd__int lisztOffset, xsd__int lisztLength, 
+	       adb__lisztResponse& adbLisztResponse){
+
+  INTSTRINGIFY(lisztOffset, lisztOffsetStr);
+  INTSTRINGIFY(lisztLength, lisztLengthStr);
+
+  char* const argv[] = {"./audioDB", COM_LISZT, "-d",dbName, "--lisztOffset", lisztOffsetStr, "--lisztLength", lisztLengthStr};
+  const unsigned argc = 8;
+  try{
+    audioDB(argc, argv, &adbLisztResponse);
+    return SOAP_OK;
+  } catch(char *err) {
+    soap_receiver_fault(soap, err, "");
+    return SOAP_FAULT;
+  }
+} 
+
 // Literal translation of command line to web service
 int adb__query(struct soap* soap, xsd__string dbName, 
 	       xsd__string qKey, xsd__string keyList,