We first need to define the interface of the Hello World server object. The client and server will communicate across this interface. The interface is defined using IDL in a single file that must have the extension
.idl
.
hello-world.idl
.
hello-world.idl
file.module HelloWorld {
interface world {
string hello();
};
};
This IDL declaration says that there are CORBA objects of a kind called
world
, and that there is an operation called
hello
on
world
objects that takes no arguments and returns a string. Servers implement
world
, and clients call
hello
on instances of
world
.
Now that we have written the IDL, we can run the IDL parser over it to produce stub and skeleton code for the client and server parts of the application.