1.3.2. The Client

Connecting with a client needs some simple steps:


  TcpIpConnection conn ("localhost", 32000); 1
  HttpProtocol prot(&conn);
  Requester client(&prot);

  MethodCall testcall ("testcall");  2
  testcall.addParam(Integer(123));

  MethodResponse resp = client.call(testcall); 3
  cout << "call result: \n" 4
       << resp.getXml(0);

1

As always: set up the connection.

2

Select the desired method by its name. In the example the method takes one parameter which is an Integer.

3

Send the call and wait for the response.

4

The example does no further processing but just shows the result as XML output.