Package bank.common

Examples of bank.common.Bank


    public static void main(String args[]) throws Exception {
        URL wsdlUrl = new URL("file:./../resources/bank.wsdl");
   
        BankCORBAService ss = new BankCORBAService(wsdlUrl, SERVICE_NAME);
        Bank port = ss.getBankCORBAPort()
       

        System.out.print("Invoking createAccount for Mr. John... ");
        javax.xml.ws.Holder<Account> account = new javax.xml.ws.Holder<Account>(new Account());
        try {
            if (port.createAccount("John", account)) {
                System.out.println("success");
            } else {
                System.out.println("failure (Unknown)");
            }
        } catch (AccountAlreadyExistsException ex) {
            System.out.println("failure (" + ex.getMessage() + " : " + ex.getFaultInfo().getName() + ")");
        }

        Account bankAccount = account.value;
        if (bankAccount != null) {
            System.out.println("Created Account : "
                               + bankAccount.getName() + ": " + bankAccount.getBalance());
        }

        System.out.println("Getting Mr. John's account...");
        try {
            bankAccount = port.getAccount("John");
            if (bankAccount != null) {
                System.out.println("success");
                System.out.println(bankAccount.getName() + ": " + bankAccount.getBalance());
            } else {
                System.out.println("failure");
            }
        } catch (AccountNotFoundException ex) {
            System.out.println("failure (" + ex.getMessage() + " : " + ex.getFaultInfo().getName() + ")");
        }      

        System.out.println("Getting an non-existent account (Ms. Helen)...");
        try {
            bankAccount = port.getAccount("Helen");
        } catch (AccountNotFoundException ex) {
            System.out.println("Caught the expected AccountNotFoundException("
                               + ex.getFaultInfo().getName() + ")");
        }
               
View Full Code Here


    public static void main(String args[]) throws Exception {
        URL wsdlUrl = Client.class.getResource("/wsdl/bank.wsdl");
   
        BankCORBAService ss = new BankCORBAService(wsdlUrl, SERVICE_NAME);
        Bank port = ss.getBankCORBAPort()
       

        System.out.print("Invoking createAccount for Mr. John... ");
        javax.xml.ws.Holder<Account> account = new javax.xml.ws.Holder<Account>(new Account());
        try {
            if (port.createAccount("John", account)) {
                System.out.println("success");
            } else {
                System.out.println("failure (Unknown)");
            }
        } catch (AccountAlreadyExistsException ex) {
            System.out.println("failure (" + ex.getMessage() + " : " + ex.getFaultInfo().getName() + ")");
        }

        Account bankAccount = account.value;
        if (bankAccount != null) {
            System.out.println("Created Account : "
                               + bankAccount.getName() + ": " + bankAccount.getBalance());
        }

        System.out.println("Getting Mr. John's account...");
        try {
            bankAccount = port.getAccount("John");
            if (bankAccount != null) {
                System.out.println("success");
                System.out.println(bankAccount.getName() + ": " + bankAccount.getBalance());
            } else {
                System.out.println("failure");
            }
        } catch (AccountNotFoundException ex) {
            System.out.println("failure (" + ex.getMessage() + " : " + ex.getFaultInfo().getName() + ")");
        }      

        System.out.println("Getting an non-existent account (Ms. Helen)...");
        try {
            bankAccount = port.getAccount("Helen");
        } catch (AccountNotFoundException ex) {
            System.out.println("Caught the expected AccountNotFoundException("
                               + ex.getFaultInfo().getName() + ")");
        }
               
View Full Code Here

TOP

Related Classes of bank.common.Bank

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.