Mercurial > hg > audiodb
comparison soap.cpp @ 550:d5ada9532a40
Implement error exits in the SOAP client when the return code is not SOAP_OK.
Corresponding fixes in the test suite, while we're at it.
author | mas01cr |
---|---|
date | Thu, 12 Feb 2009 10:44:54 +0000 |
parents | e18843dc0aea |
children | 5b2c0d9bc63d |
comparison
equal
deleted
inserted
replaced
549:0694bb74c5e9 | 550:d5ada9532a40 |
---|---|
18 std::cout << "length = " << adbStatusResponse.result.length << std::endl; | 18 std::cout << "length = " << adbStatusResponse.result.length << std::endl; |
19 std::cout << "dudCount = " << adbStatusResponse.result.dudCount << std::endl; | 19 std::cout << "dudCount = " << adbStatusResponse.result.dudCount << std::endl; |
20 std::cout << "nullCount = " << adbStatusResponse.result.nullCount << std::endl; | 20 std::cout << "nullCount = " << adbStatusResponse.result.nullCount << std::endl; |
21 std::cout << "flags = " << (adbStatusResponse.result.flags & 0x00FFFFFF) << std::endl; | 21 std::cout << "flags = " << (adbStatusResponse.result.flags & 0x00FFFFFF) << std::endl; |
22 } else { | 22 } else { |
23 soap_print_fault(&soap,stderr); | 23 char fault[MAXSTR]; |
24 soap_sprint_fault(&soap, fault, MAXSTR); | |
25 error(fault); | |
24 } | 26 } |
25 | 27 |
26 soap_destroy(&soap); | 28 soap_destroy(&soap); |
27 soap_end(&soap); | 29 soap_end(&soap); |
28 soap_done(&soap); | 30 soap_done(&soap); |
37 for(int i = 0; i < adbLisztResponse.result.__sizeRkey; i++) { | 39 for(int i = 0; i < adbLisztResponse.result.__sizeRkey; i++) { |
38 std::cout << "[" << i+lisztOffset << "] " << adbLisztResponse.result.Rkey[i] << " (" | 40 std::cout << "[" << i+lisztOffset << "] " << adbLisztResponse.result.Rkey[i] << " (" |
39 << adbLisztResponse.result.Rlen[i] << ")" << std::endl; | 41 << adbLisztResponse.result.Rlen[i] << ")" << std::endl; |
40 } | 42 } |
41 } else { | 43 } else { |
42 soap_print_fault(&soap, stderr); | 44 char fault[MAXSTR]; |
43 } | 45 soap_sprint_fault(&soap, fault, MAXSTR); |
46 error(fault); | |
47 } | |
48 soap_destroy(&soap); | |
49 soap_end(&soap); | |
50 soap_done(&soap); | |
44 } | 51 } |
45 | 52 |
46 // WS_QUERY (CLIENT SIDE) | 53 // WS_QUERY (CLIENT SIDE) |
47 void audioDB::ws_query(const char*dbName, const char *featureFileName, const char* hostport){ | 54 void audioDB::ws_query(const char*dbName, const char *featureFileName, const char* hostport){ |
48 struct soap soap; | 55 struct soap soap; |
70 std::cout << adbQueryResponse.result.Rlist[i] << " " | 77 std::cout << adbQueryResponse.result.Rlist[i] << " " |
71 << adbQueryResponse.result.Spos[i] << std::endl; | 78 << adbQueryResponse.result.Spos[i] << std::endl; |
72 } | 79 } |
73 } | 80 } |
74 } else { | 81 } else { |
75 soap_print_fault(&soap,stderr); | 82 char fault[MAXSTR]; |
83 soap_sprint_fault(&soap, fault, MAXSTR); | |
84 error(fault); | |
76 } | 85 } |
77 | 86 |
78 soap_destroy(&soap); | 87 soap_destroy(&soap); |
79 soap_end(&soap); | 88 soap_end(&soap); |
80 soap_done(&soap); | 89 soap_done(&soap); |
120 adbQueryResponse)==SOAP_OK){ | 129 adbQueryResponse)==SOAP_OK){ |
121 //std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl; | 130 //std::std::cerr << "result list length:" << adbQueryResponse.result.__sizeRlist << std::std::endl; |
122 for(int i=0; i<adbQueryResponse.result.__sizeRlist; i++) | 131 for(int i=0; i<adbQueryResponse.result.__sizeRlist; i++) |
123 std::cout << adbQueryResponse.result.Rlist[i] << " " << adbQueryResponse.result.Dist[i] | 132 std::cout << adbQueryResponse.result.Rlist[i] << " " << adbQueryResponse.result.Dist[i] |
124 << " " << adbQueryResponse.result.Qpos[i] << " " << adbQueryResponse.result.Spos[i] << std::endl; | 133 << " " << adbQueryResponse.result.Qpos[i] << " " << adbQueryResponse.result.Spos[i] << std::endl; |
125 } | 134 } else { |
126 else | 135 char fault[MAXSTR]; |
127 soap_print_fault(&soap,stderr); | 136 soap_sprint_fault(&soap, fault, MAXSTR); |
128 }else | 137 error(fault); |
138 } | |
139 } else | |
129 ;// FIX ME: WRITE NON-SEQUENCE QUERY BY KEY ? | 140 ;// FIX ME: WRITE NON-SEQUENCE QUERY BY KEY ? |
130 | 141 |
131 soap_destroy(&soap); | 142 soap_destroy(&soap); |
132 soap_end(&soap); | 143 soap_end(&soap); |
133 soap_done(&soap); | 144 soap_done(&soap); |