|
Larry, I am not familiar with the Mochasoft Java API but you may want to take a quick look at the tn5250j project at source forge. They have encapsulated most of the TN5250 capability into an easy to use bean that makes creating 5250 based apps a snap. Although there isn't a screen scraper app currently, we are looking at adding one. I am currently working on (on and off as most Open Source projects are ) an HTML based 5250 emulator (like iSeries Access for web) and I think we can begin to build objects/methods that translate the 5250 fields into HTML objects soon. It is worth looking into if you fail to get resolution on your Mochasoft API's. Tn5250j is found at http://sourceforge.net/projects/tn5250j/ Pete Helgren Value Added Software, Inc 801.581.1154 x202 -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Larry Sent: Thursday, January 13, 2005 8:47 AM To: JAVA400-L@xxxxxxxxxxxx Subject: Java API for MOCHASOFT Mochasoft has a java api for its java based emulator that allows one to screen scrape. I have a few *limited* instances where screen scraping would be an enormous benefit. This program is really inexpensive and the API looked easy so I tried it out. I was quickly able to get the sign on screen and effectively sign on and get to the next screen. No problem. But what I can't seem to do is to get the buffer for any screen after the intial screen. Repeated calls to do_read_all() even after a do_wait_input(100) get the original buffer data for the sign on screen. I tried longer waits, changing byte variables, NULLing out the buffer array before the next calls and get the same results. Since I can watch the session in a separate window I know I am moving to new screens on the 400. It just isn't reflected in the do_read_all(). Has anyone used this API? I was hoping that perhaps someone may have a simple example of a multi-screen screen scrape that works. A very simple sample of my test program is shown below for those that want to look. Thanks, Larry public class Test2 { public static void main(String[] args) { byte buf[][]; // screen byte ttt[]={72,72,71,71,71,71,71,72,72}; // very simple password hiding String sss = new String(ttt); // save password as string for later use api_tn5250 a = new api_tn5250(); a.do_load_config("tn5250.cfg"); a.use_display(false,true); // hidden,standalone if (a.do_connect("mySystem",23) == true) { a.do_wait_input(0); buf = a.do_read_all(); a.do_goto_field(1); a.do_write_text("LARRY"); //userid a.do_goto(18,6); a.do_write_text(sss); //password a.do_aid_key(0xf1); //enter key a.do_wait_input(0); buf = a.do_read_all(); //Print out first line of screen for identification int x=1; for (int y=0;y<buf[x].length;y++){ System.out.println(x+": "+buf[x][y]+" : "+(char)(buf[x][y])); } System.out.println(""); a.do_disconnect(); System.out.println("\nDisconnected"); } System.exit(0); } } _______________________________________________ No banners. No pop-ups. No kidding. Make My Way your home on the Web - http://www.myway.com -- This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.