#include <staff/utils/Log.h>
#include <staff/common/logoperators.h>
#include <staff/client/Options.h>
#include <staff/common/Exception.h>
#include <staff/client/ServiceClient.h>
#include <staff/common/DataObject.h>
#include <iostream>
int main(int /*nArgs*/, const char* /*paszArgs*/[])
{
try
{
staff::ServiceClient tClient;
tClient.Init("https://...");
staff::Options &tOptions = tClient.GetOptions();
tOptions.SetProperty("SERVER_CERT", "C:\\ws\\server.pem");
tOptions.SetProperty("KEY_FILE","C:\\ws\\client.pem");
tOptions.SetProperty("SSL_PASSPHRASE","...");
staff::DataObject tdoPayLoad("Echo");
tdoPayLoad.DeclareNamespace("https://...","");
tdoPayLoad.CreateChild("message","Echo");
std::cout << "Request: \n---\n" << tdoPayLoad.ToString();
staff::DataObject result = tClient.Invoke(tdoPayLoad);
std::cout << "Response: \n---\n" << result.ToString() << std::endl;
std::string resultString = "";
result.GetChildValueByLocalName("EchoResult",resultString);
std::cout <<"Result: "<< resultString;
}
STAFF_CATCH_ALL
return 0;
}