IDL example

The following example describes a bank account whose contents can be queried and updated. Note that this example has a parameter that identifies the instance of the BankAccount, to satisfy the 'stateless' restriction. The following IDL defines the interface and operations:
  module bank {
 
  // this interface is used to manage the bank accounts
  interface BankAccount {
    exception ACCOUNT_ERROR { long errcode; string message;};
 
    // query methods
    long querybalance(in long acnum) raises (ACCOUNT_ERROR);
    string queryname(in long acnum) raises (ACCOUNT_ERROR);
    string queryaddress(in long acnum) raises (ACCOUNT_ERROR);
 
    // setter methods
    void setbalance(in long acnum, in long balance) raises (ACCOUNT_ERROR);
    void setaddress(in long acnum, in string address) raises (ACCOUNT_ERROR);
};
};    

In this example, the module name is bank, the interface name is BankAccount and the Operations are querybalance, and setbalance.