comparison 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
comparison
equal deleted inserted replaced
333:cc3f9d1ca2cd 334:100cf66a5825
24 } 24 }
25 25
26 soap_destroy(&soap); 26 soap_destroy(&soap);
27 soap_end(&soap); 27 soap_end(&soap);
28 soap_done(&soap); 28 soap_done(&soap);
29 }
30
31 void audioDB::ws_liszt(const char* dbName, char* Hostport){
32 struct soap soap;
33 adb__lisztResponse adbLisztResponse;
34
35 soap_init(&soap);
36 if(soap_call_adb__liszt(&soap, hostport, NULL, (char*)dbName, lisztOffset, lisztLength, adbLisztResponse)==SOAP_OK){
37 for(int i = 0; i < adbLisztResponse.result.__sizeRkey; i++) {
38 std::cout << "[" << i+lisztOffset << "] " << adbLisztResponse.result.Rkey[i] << " ("
39 << adbLisztResponse.result.Rlen[i] << ")" << std::endl;
40 }
41 } else {
42 soap_print_fault(&soap, stderr);
43 }
29 } 44 }
30 45
31 // WS_QUERY (CLIENT SIDE) 46 // WS_QUERY (CLIENT SIDE)
32 void audioDB::ws_query(const char*dbName, const char *featureFileName, const char* hostport){ 47 void audioDB::ws_query(const char*dbName, const char *featureFileName, const char* hostport){
33 struct soap soap; 48 struct soap soap;
136 } catch(char *err) { 151 } catch(char *err) {
137 soap_receiver_fault(soap, err, ""); 152 soap_receiver_fault(soap, err, "");
138 return SOAP_FAULT; 153 return SOAP_FAULT;
139 } 154 }
140 } 155 }
141 156
157 int adb__liszt(struct soap* soap, xsd__string dbName, xsd__int lisztOffset, xsd__int lisztLength,
158 adb__lisztResponse& adbLisztResponse){
159
160 INTSTRINGIFY(lisztOffset, lisztOffsetStr);
161 INTSTRINGIFY(lisztLength, lisztLengthStr);
162
163 char* const argv[] = {"./audioDB", COM_LISZT, "-d",dbName, "--lisztOffset", lisztOffsetStr, "--lisztLength", lisztLengthStr};
164 const unsigned argc = 8;
165 try{
166 audioDB(argc, argv, &adbLisztResponse);
167 return SOAP_OK;
168 } catch(char *err) {
169 soap_receiver_fault(soap, err, "");
170 return SOAP_FAULT;
171 }
172 }
173
142 // Literal translation of command line to web service 174 // Literal translation of command line to web service
143 int adb__query(struct soap* soap, xsd__string dbName, 175 int adb__query(struct soap* soap, xsd__string dbName,
144 xsd__string qKey, xsd__string keyList, 176 xsd__string qKey, xsd__string keyList,
145 xsd__string timesFileName, xsd__string powerFileName, 177 xsd__string timesFileName, xsd__string powerFileName,
146 xsd__int qType, 178 xsd__int qType,