The following example defines two CORBA interfaces. These interfaces, written
in the CORBA interface-definition language (IDL), define methods to test the
interoperability of CORBA data types between an enterprise bean running in
the WebSphere Application Server and a CORBA server running on a third-party
ORB. The Primitive interface defines the methods for testing the primitive
CORBA data types, for example, characters, octets, integers, and floats. The
Complex interface defines similar methods for the CORBA data types any and
Object.
For each data type, there are three methods; each one returns the value
in a different way. For example, the Primitive interface defines the following
methods for a short integer:
...
interface Primitive
{
const string serviceName = "primitive";
const string testShortName = "short";
short testShortIn(in short argin);
void testShortOut(in short argin,
out short argout);
void testShortInOut(inout short arginout);
// Parallel methods for other data types
...
}
...
In the first method, the client sends the value in by using an in
argument,
and the server returns the result as the value of the method. In the second
method, the client sends the value in the first argument, and the server returns
it in by using the out
argument.. In the third method, the client
sends the value in by using an inout
argument, which the server
modifies to return the value. For each data type in each interface, a similar
set of methods exists. The methods in the Complex interface are structured
similarly.