// Client.java // Simple client for the StreetRouter Proxy. This client runs as an // application import java.io.*; public class Client { private static org.omg.CORBA.ORB orb; private static Proxy.StreetRouter proxy; public static void main(String[] args) { // Initialize the ORB. orb = org.omg.CORBA.ORB.init(args,null); // Getting a Proxy from the InfoBus naming service. This actually // involves a http connection, so it might take a while. If you don't // want to get the server from InfoBus, comment this line. // The first parameter of this call is the context where InfoBus // will place the server, the second is the name of the service, // and the third is a pointer to your ORB. Please, // contact paepcke@db.stanford.edu to know what contexts and names // are suitable here. proxy = Proxy.StreetRouterHelper.narrow(naming.GetObject( "dl/Services/Search","StreetRouterSimple",orb)); // Get a Proxy from the local OSAgent //proxy = // Proxy.StreetRouterHelper.bind(orb,"StreetRouter"); // Sending a request to the server..... String directions = proxy.lookupdirections("Stanford", "California", "Los Angeles", "California"); System.out.println(directions); } }