FileDocCategorySizeDatePackage
HandlerBookServiceClient.javaAPI DocExample1521Tue Dec 17 23:15:52 GMT 2002ora.jwsnut.chapter6.client

HandlerBookServiceClient

public class HandlerBookServiceClient extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

        
        try {
            // Get a reference to the stub.
            HandlerBookService_Impl service = new HandlerBookService_Impl();
            HandlerBookQuery bookQuery = (HandlerBookQuery)service.getHandlerBookQueryPort();
            
            // Get info for each book.
            StringHolder stringHolder = new StringHolder();

            int count = bookQuery.getBookCount();
            System.out.println("Book count = " + count);
            
            for (int i = 0; i < count; i++) {
                String title = bookQuery.getBookTitle(i);
                bookQuery.getBookAuthor(title, stringHolder);
                System.out.println("Title: " + title + ", author: " + stringHolder.value);                
            }
            
            // Log success
            bookQuery.log("HandlerBookServiceClient: success");
            
            System.exit(0);
        } catch (Throwable t) {
            System.out.println("CLASS: " + t.getClass().getName() + "\n\n");
            System.out.println(t.getMessage());
            t.printStackTrace(System.out);
        }