[Enterprise Extensions only]

Developing a C++ CORBA client

Use this task to develop a C++ CORBA client. This task generates and registers the client DLLs and the client-side usage bindings needed by C++ CORBA client programs to access an object class (Enterprise JavaBean or CORBA servant object) hosted by an application server.

To develop a C++ CORBA client, you complete the following steps:

  1. Create the interface definition (IDL) files that specifies the public interface to the server implementation object class. If you want the client to access a CORBA server implementation class, you create the IDL file as part of the procedure to define the servant implementation, as described in Defining the interface for a servant implementation (servant.idl).. If you want the client to access an Enterprise JavaBean, you can create the IDL file from the bean class, as described in Creating IDL files for an Enterprise JavaBean.
  2. Use the idlc command to emit the client-side usage bindings from the IDL, specifying the option -suc:hh.
    If you want the client to access a CORBA server implementation, you emit the client-side usage bindings when you compile the servant.idl file, as described in Compiling the servant IDL (using idlc). If you want the client to access an Enterprise JavaBean, you can use the same procedure with the IDL file created from the bean class.
    For example, to emit the client-side bindings from the Hello.idl file, at a command line change to the directory that contains the IDL file, then type the following command:
    idlc -suc:hh Hello.idl

    When the specified idl file is compiled successfully, the idlc command creates the binding files and returns a value of zero. For example, for the above example idlc command, the following binding files are created: Hello.hh and Hello_C.cpp

  3. Create the main code for the client program, as described in, Creating the CORBA client main code (client.cpp).

You can next compile and link the C++ client main program, as described in Compiling a C++ client program.