An Architecture for Web Services
by David Houlding

Listing One 
module StoreServer {
    struct ItemDescription {
        long year;
        string manufacturer;
        string model;
        string description;
    };
    struct ItemRecord {
        ItemDescription description;
        double cost;
    };
    typedef sequence<ItemRecord> ItemSequence;
    interface InventoryServer {
        ItemSequence getItems( in long year, 
                               in boolean includeBefore, 
                               in boolean includeAfter );
        long inventory( in ItemDescription itemDescription );
    };
};


Listing Two 
// Instantiate proxy bean.
DynamicRequest request = (DynamicRequest) Beans
    .instantiate( null, "corbabeans.InventoryServer1_getItems" );
// Set dynamic request input arguments.
request.setArgParamVal( "year", new Integer( 1997 ) );
request.setArgParamVal( "includeBefore", new Boolean( false ) );
request.setArgParamVal( "includeAfter", new Boolean( false ) );
// Invoke dynamic request.
request.invoke();
// Get results from invoking dynamic request.
int numItems = ( (SequenceParameter) request
    .getReturnParam( "return" ) ).getLength();
for( int i = 0; i < numItems; ++i ) {
    System.out.println( request.getReturnParamVal(
        "return[" + i + "].description.manufacturer" ) );
}





7


