CORBA has a reputation for being hard to use, but it is really very easy, expecially if you use Python. This example shows the complete implementation of a fortune cookie server and its client.
Python, 48 lines
To run this example, you need a Python CORBA implementation. With most ORBs, you must convert the IDL interface definition into Python declarations with an IDL compiler. For example, with omniORBpy you do:
omniidl -bpython fortune.idl
This creates modules named Fortune and Fortune__POA, to be used by clients and servers.
When you run the server, it prints out a long hex string like
IOR:010000001d00000049444c3a466f7274756e652f436f6f6b69655365727665723 a312e3000000000010000000000000060000000010102001200000068656c6c6f2e65 78616d706c652e636f6d00f90a07000000666f7274756e65000200000000000000080 000000100000000545441010000001c00000001000000010001000100000001000105 090101000100000009010100
Give that to the client's orb.string_to_object() call to contact your server. Notice that about half the server's code is dealing with obtaining the fortune cookie, and nothing to do with CORBA at all.
It's easy to make your server support a simple corbaloc URL string like the client example, but that involves some omniORB specific code. See the omniORBpy manual for details.
There used to be a live Fortune server running at AT&T Laboratories Cambridge, but the lab closed in April 2002, so the server is no longer available.
Download omniORBpy from http://omniorb.sourceforge.net/