10 #include <thrift/protocol/TBinaryProtocol.h>
11 #include <thrift/transport/THttpClient.h>
12 #include <boost/shared_ptr.hpp>
13 #include "test_service.h"
15 int main(
int argc,
char** argv) {
16 using namespace apache::thrift::protocol;
17 using namespace apache::thrift::transport;
18 boost::shared_ptr<THttpClient> transport(
new THttpClient(
"localhost", 8080,
"/test?id=42"));
19 boost::shared_ptr<TBinaryProtocol> protocol(
new TBinaryProtocol(transport));
20 test_serviceClient client(protocol);
25 std::cout <<
"Sending request" << std::endl;
28 std::cout <<
"lookup(id=" << m.id <<
", name=" << m.name <<
")" << std::endl;
31 }
catch (TTransportException& e) {
32 std::cerr << e.what() << std::endl;
int main(int argc, char **argv)