Rework the parsing of soap response.

This commit is contained in:
Chunting Gu
2018-09-20 15:24:54 +08:00
parent f5fe4e67f7
commit 76417c3703
17 changed files with 228 additions and 51 deletions
+4 -2
View File
@@ -5,6 +5,8 @@
// -----------------------------------------------------------------------------
static const std::string kResultName = "Result";
class CalcClient {
public:
CalcClient(const std::string& host, const std::string& port)
@@ -15,7 +17,6 @@ class CalcClient {
soap_client_.set_service_ns({
"ser", "http://www.example.com/calculator/"
});
soap_client_.set_result_name("Result");
// Customize request XML format.
soap_client_.set_format_raw(false);
@@ -54,7 +55,8 @@ class CalcClient {
};
std::string result_str;
if (!soap_client_.Request(operation, std::move(parameters), &result_str)) {
if (!soap_client_.Request(operation, std::move(parameters), kResultName,
&result_str)) {
PrintError();
return false;
}