Writing a CORBA client to an enterprise bean

For client programming languages other than Java, such as C++, the CORBA architecture is often the only viable option for accessing enterprise beans. Enterprise beans are available to CORBA clients through the CORBA programming model as follows:
  • Write the enterprise bean.
  • Generate IDL for the enterprise bean, using the RMI compiler with the -IDL option. (This is the reverse of the typical CORBA model, in which IDL is used to generate the object.)

    Serializable objects used in the bean interfaces will be expressed in IDL as CORBA valuetypes. If you use only CORBA primitives as data and return types, it will be easier to access the bean from non-Java clients.

  • Using an IDL compiler suitable for the client environment, compile the IDL to generate client-side stubs.
  • Write the client, using the generated stub.
  • Make an IOR for the enterprise bean available to the client application. The IOR contains sufficient information for any CORBA ORB to locate the enterprise bean.
Even if a session bean has been coded to use only CORBA primitives as parameter and return types, exception types are still returned as CORBA valuetypes. If your CORBA client ORB does not support valuetypes, you will be forced to work with unknown exceptions.
Note: It is not recommended to use a Java CORBA client to an enterprise bean. Use RMI-IIOP instead.