package ejb.slrStory;

/*
 *
 * Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the proprietary information of Sun Microsystems, Inc.  
 * Use is subject to license terms.
 * 
 */

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;




public class SLRStoryClient {

    public static void main(String[] args) {
        try {
            Context initial = new InitialContext();
            Object objref = initial.lookup("SLRStoryEJB");

            SLRStoryHome home = 
                (SLRStoryHome)PortableRemoteObject.narrow(objref, 
                                            SLRStoryHome.class);

            SLRStory slrStory = home.create();
            //StringBuffer contents = slrStory.getContents("http://130.159.78.177:8000/index.html");
            StringBuffer contents = slrStory.getContents("http://130.159.78.177:8000/slrStory/sresA1.html");
	        System.out.println("The contents of the HTML page follows:\n");
            System.out.print(contents);

        }

        catch (Exception ex) {
           System.err.println("SLRStoryClient.main(), Caught an unexpected exception!");
                                ex.printStackTrace();
        }
    } 
}
