XML and CORBA
by Dirk Hamstra


Listing One
<module>
    <name> banking </name>
    <interface>
        <name> savings_account </name>
        <inherits> bank_account </inherits>
        <operation>
            <name> deposit </name>
            <param>
                <name> amount </name>
                <type> money </type>
                <direction> in </direction>
                        </param>
        </operation>
    </interface>
</module>

Listing Two
module banking
{
        interface savings_account : bank_account
                {
            void deposit (in money amount);
        };
};

Listing Three
//given Object bankObj
JavaToXML translator=new JavaToXML();
String xml=translator.toXML(bankObj)

Listing Four
String[][] accountInfo=new String[1][1];
accountinfo[0][0]="Red R Hood";
System.out.println(xml.toXML(accountInfo));

Listing Five
<java.lang.String dimension=2 length=1>
    <item length=1>
        <item> Red R Hood </item>
    </item>
</java.lang.String>

Listing Six
<servicename>:\ChicoSpuugBeest:ddjdem:::IR:Bank</servicename>
<method>accountList</method>
<argument>
     <arg flag=in>
        <customerId>123456ABD</customerId>
     </arg>
     <arg flag=in>
                <accountNo> * </accountNo>
     </arg>
</argument>
<returntype>CustomerAccountSeq</returntype>

Listing Seven
interface accountView
    {
        exception reject {
             string reason; // error text};
                attribute string userId;
                attribute string password;
                attribute string customerId;
                attribute float accountNo;

                account accountLogin (in userId, inpassword)
                raises (reject, invalidLogon);
                account accountList (in customerId, in accountNo,
                    out sequence CustomerAccountSequence)
                    raises (reject, invalidCustomerID);
    };





2


