~ubuntu-branches/ubuntu/raring/gsoap/raring-proposed

« back to all changes in this revision

Viewing changes to gsoap/samples/xml-rpc-json/xml-rpc-currentTime.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2011-11-01 05:14:38 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20111101051438-3bm51yiv71ng1uc6
Tags: 2.8.4-1
* New upstream release
* Drop gsoap-ipv6.patch implemented upstream
* Link gsoap SSL shared libraries with libssl (Closes: #646228)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
        Compile:
9
9
        soapcpp2 xml-rpc.h
10
 
        cc xml-rpc-currentTime.cpp xml-rpc.cpp xml-rpc-io.cpp stdsoap2.cpp soapC.cpp
 
10
        cc xml-rpc-currentTime.cpp xml-rpc.cpp xml-rpc-io.cpp stdsoap2.cpp soapC.cpp -lpthread
11
11
 
12
12
--------------------------------------------------------------------------------
13
13
gSOAP XML Web services tools
44
44
 
45
45
int main()
46
46
{
47
 
  soap *ctx = soap_new();
 
47
  soap *ctx = soap_new1(SOAP_IO_KEEPALIVE | SOAP_XML_INDENT);
 
48
  ctx->send_timeout = 10; // 10 sec, stop if server is not accepting msg
 
49
  ctx->recv_timeout = 10; // 10 sec, stop if server does not respond in time
 
50
 
48
51
  // set up the method call
49
52
  methodCall m(ctx, "http://time.xmlrpc.com/RPC2", "currentTime.getCurrentTime");
50
53
  // make the call and get response params
58
61
  // print time in JSON format (just a string as per json.h)
59
62
  else
60
63
    cout << "Time = " << r[0] << endl;
 
64
 
61
65
  // clean up
62
66
  soap_destroy(ctx);
63
67
  soap_end(ctx);