[Enterprise Extensions only]

Developing a CORBA server

Use this task to develop a CORBA server to service requests for business functions used in the implementation of client objects. The instructions and code extracts provided in this task are based on the development of the WSLoggerServer sample, for which files are included with WebSphere in the following directory: WAS_HOME/Enterprise/samples/sampcppsdk.

Developing a CORBA server involves developing a server implementation class (known as a servant) and a server, as described in the following steps:

  1. Create and edit an IDL file, servant.idl, to specify the public interface to the servant object class; where servant is the name of the server implementation class.
    For more information about creating and editing an IDL file for the servant object class, see Defining the interface for a servant implementation (servant.idl).

    This steps results in a fully-specified servant.idl file.

  2. Compile the servant IDL file,servant.idl, to produce the usage binding files needed to implement and use the servant object within a particular programming language.
    For more information about compiling an IDL file, see Compiling the servant IDL (using idlc).

    This step results in the set of usage binding files required for the servant.idl file.

  3. Add declarations for class variables, constructors, and destructors to the servant implementation header (servant.ih).
    For more information about adding declarations to an implementation header, see Adding declarations to a CORBA servant implementation header (servant.ih).

    This step results in the servant implementation header file, servant.idl, that contains all the declarations for class variables, constructors, and destructors needed by the implementation.

  4. Complete the servant implementation servant_I.cpp, to add the code that is to implement the servant business logic.
    For more information about completing the servant implementation, see Adding code to a CORBA servant implementation (servant_I.cpp).

    This step results in the server implementation file, servant_I.cpp, that contains the code needed by the implementation to support the business logic.

  5. Create the server main, server.cpp, to write the code for the methods that the server implements (for example, to perform initialization tasks and create servant objects).
    For more information about completing the servant implementation, see Creating the server main code (server.cpp).

    This step results in the server main source file, server.cpp, that contains the main method and associated code needed to implement the server.

  6. Build the server code, as described in Building a C++ CORBA server.