Creating applications : Creating applications : Rich Client HelloWorld sample : Overview of Rich Client HelloWorld sample : Invoking an operation
  
Invoking an operation
The following must be true before a client operation can invoke its counterpart operation on the server side:
The csRequestFormat (for sending from client to server) is defined in the client operation and in the server operation
The csReplyFormat (for sending from server to client) is defined in the server operation and in the client operation
Both are externalized as part of the operation data, or may be assigned programmatically in the concrete operation implementation
To perform an operation, the client operation gets a CSClient instance and call its sendAndWait method, passing itself as a parameter, as follows:
((CSClientService) getService("CSClient")).sendAndWait(this,10000);
This code example sends the request to the server and waits 10 seconds for the response. Some exceptions (for instance, when the timeout expires) must be handled.
This code sends a data buffer to the server side in order to invoke the server operation and execute its operation flow, and then waits for the reply. Once the reply arrives on the client, the Rich Client Channel unformats the incoming stream and updates the operation context.
However, it is not mandatory that while the ServerOperation is executing, the client-side process remains blocked.
See Client/Server operation process for detailed information of operation invocation.
Go up to
Overview of Rich Client HelloWorld sample