Next Previous Up Top Contents Index

2.5 Implementing the client

2.5.3 Invoking an operation

Our client has now initialized the ORB and obtained the world object reference it required. It is ready to invoke the hello operation and receive the string that it needs to print out.

Because all the initialization work is complete, this step is trivial. We simply call the hello operation directly, and let the underlying stub code deal with the business of sending the request to the server and receiving the response.

The IDL for hello was translated into the Dylan protocol library, My-Hello-World-Protocol, as world/hello. Though in IDL the operation did not have any arguments, when calling it from the Dylan client we do need to pass the reference of the CORBA object we are invoking the operation upon, since ORBs need to know which object, of perhaps many the client has references to, is actually being called.

The call is therefore simply:

world/hello(world)

The implementation of the client is therefore complete after the following call:

format-out("%s\n", world/hello(world));

This code gets the string and then prints it to the standard output.


Developing Component Software with CORBA - 26 May 1999

Next Previous Up Top Contents Index