Replace boost thread with std thread; update rest book example; move soap tutorials to wiki.

This commit is contained in:
Adam Gu
2018-07-23 15:40:58 +08:00
parent 6475a3fd35
commit 33f2b84f8c
11 changed files with 64 additions and 446 deletions
+5 -14
View File
@@ -11,7 +11,11 @@ bool CalcService::Handle(const webcc::SoapRequest& soap_request,
webcc::SoapResponse* soap_response) {
double x = 0.0;
double y = 0.0;
if (!GetParameters(soap_request, &x, &y)) {
try {
x = std::stod(soap_request.GetParameter("x"));
y = std::stod(soap_request.GetParameter("y"));
} catch (const std::exception& e) {
LOG_ERRO("SoapParameter cast error: %s", e.what());
return false;
}
@@ -61,16 +65,3 @@ bool CalcService::Handle(const webcc::SoapRequest& soap_request,
return true;
}
bool CalcService::GetParameters(const webcc::SoapRequest& soap_request,
double* x, double* y) {
try {
*x = std::stod(soap_request.GetParameter("x"));
*y = std::stod(soap_request.GetParameter("y"));
} catch (const std::exception& e) {
LOG_ERRO("SoapParameter cast error: %s", e.what());
return false;
}
return true;
}
-4
View File
@@ -10,10 +10,6 @@ class CalcService : public webcc::SoapService {
bool Handle(const webcc::SoapRequest& soap_request,
webcc::SoapResponse* soap_response) override;
private:
bool GetParameters(const webcc::SoapRequest& soap_request,
double* x, double* y);
};
#endif // CALC_SERVICE_H_