try {
if (args.length != 1) {
usage();
}
// Get a reference to the stub and set the service address
BookService_Impl service = new BookService_Impl();
BookQuery bookQuery = (BookQuery)service.getBookQueryPort();
((Stub)bookQuery )._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, args[0]);
// Perform the RPC and print the results
HashMap map = bookQuery.getBookMap();
Iterator iter = map.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
BookInfo info = (BookInfo)entry.getValue();
System.out.println("KEY: [" + entry.getKey() + "], value = "+
info.getTitle() + " by " +
info.getAuthor() + ", edited by " +
info.getEditor() + ", price USD " +
info.getPrice());
}
System.exit(0);
} catch (Throwable t) {
System.out.println("CLASS: " + t.getClass().getName() + "\n\n");
System.out.println(t.getMessage());
t.printStackTrace(System.out);
}