EasyWeb is a Web-database accessing middleware developed by the author recently to interconnect Foxpro databases with Web systems. It provides a very simple API for dynamic web creators to publish data stored in Foxpro onto Web and collect user input from web browsers into Foxpro. It's developed according to the domestic situation that Foxpro is very much widely used in China and such a middleware is badly needed. EasyWeb is characterized as exclusively used for Foxpro, compatible with most web servers on Windows, very easy to code, small and smart compared with analogous products worldwide. The theory, scheme, and realization of EasyWeb is given in detail in this paper along with an application example.Topics: API, Middleware
Keywords:Web-database middleware Foxpro Intranet
     Being the hot research area internationally, most relative research organizations and software vendors devoted greatly into Web-Database technology. Since each concerns differently, the large database vendors committed themselves to efficient middlewares dedicated to their own databases, while the Web server or OS vendors hammer at general purpose middlewares which can access most pop databases. Comparatively, the research into Foxpro on Web is rare.
     While in China, Foxpro is very widely used. At the same time, many domestic companies are planning to build or are building their own Intranet. So research into the technology of integrating Foxpro and Web, and developing such middleware product is an exigent requirement in China. And there's broad prospect and extensive market for it.
    
Aiming at such situations, the author hope to develop a Web-database accessing middleware which is exclusively used for Foxpro databases, compatible with most pop Web servers, smart and quick, and also economical. This is what we are now discussing in this paper--EasyWeb, now 1.0.
     To introduce databases into Web systems, the general way is to adopt proper middleware to "glue" the two systems. The techniques available now to develop Web-Database middleware include:
     While CGI is really full-blown and universally supported. On the other hand, being a small-scale, desktop database, the application occasion and data volume of Foxpro determined usually they're not key applications very densely visited. So developing with CGI will not cause a bottleneck in Web server. In sum, CGI is the best choice to develop EasyWeb with.
    
EasyWeb is a middleware to connect Foxpro databases onto Web. Its function is to interact with Web server through CGI and supply a simple API to users. To create a dynamic web page under EasyWeb, users just write a normal Foxpro program, in which query about Foxpro database(s) are done according to the various input data from browser, and the result page is constructed and returned. EasyWeb and this user write program are parent and child programs. They two together accomplish the Web-database accessing task. In this progress, the software modules and their relationship can be illustrated as the following figure :
    
What the dynamic web page creator see and use is just EasyWeb's interface. So EasyWeb hides the CGI from users and provides a high-level, easy-to-use interface.
     Foxpro is a database on DOS/Windows platform, so it can be accessed with ODBC, Foxpro DBMS or self-developed application. Self-developing a database accessing application requires large amount of work, and the reliability could not be guaranteed at all. So this method should not be adopted casually.
     ODBC, which was provided by Microsoft, aims at supplying a unified and simple access interface to various databases. So it's database accessing mechanism accordingly is: an application calls the ODBC Driver Manager, who then calls the corresponding Driver, the later then interact with the database server, and the result is returned via all these in reverse. So we can see ODBC is multi-layered and inefficient. It's not proper to apply it to a system exclusively used for Foxpro.
    
Visual Foxpro 5.0 is the highest version of Foxpro and it's the fastest while accessing Foxpro databases; it's also of good compatibility, capable of accessing every version of previous Foxpro databases. So VFP5 is chosen as the database accessing tool of EasyWeb.
     CGI consists of standard CGI and Windows CGI. Command line parameters, environment variables and standard I/O are important communication methods of standard CGI. While most developing tools on Windows platform, such as VB, Delphi, including VFP, do not have standard I/O, thus developing standard CGI programs in these language tends to be very difficult.
     Against these situations, people proposed Windows CGI specification, which replaced standard I/O with spooling file buffer. Thus all kinds of language on Windows can be used to write CGI programs.
    
Under the decision of developing in Windows CGI, along with that of using VFP5 to access Foxpro databases explained in the last section, the middleware can be developed with VFP5 directly. Consequently it's capable of both accessing databases and interacting with Web servers. Thus EasyWeb is of the simplest layer and highest compact level.
     The user's programming interface of EasyWeb 1.0 is very simple, including mainly a function and a global variable.
     To get user input from the browser, just call function FormField() with the parameter the name string of the input field desired. And the result page is to be simply stored in the global variable html_out as a string.
    
As for advanced users who want to use CGI variables, he/she can get the value of a Windows CGI variable by calling function CGI_vars() with the parameter the name string of the variable.
Web servers on Windows (Windows 95, Windows NT 3.51 and above) which support Windows CGI (version 1.3a) specification, including most web servers on Windows platform, such as NetScape Enterprise/FastTrack server, WebSite, ZBServer, CommerceBuilder.
Every version of Foxpro databases from 2.5 is supported, and they can be located on all versions of DOS, Novell NetWare and Windows platforms.
     In the construction of the online system of NO3 Auto-Fixing Factory, Beijing ( QX_online ), EasyWeb is used to connect Web system and the existing MIS of the factory which was a Foxpro 2.5B system.
     The network of the factory is a 10M Ethernet, hosting 2 sub-MIS systems, whose servers are both high-performance PCs, running Novell NetWare 3.12 and 4.10 respectively. Each subsystem has some PC workstations. And the database systems are both Foxpro 2.5B.
     QX_online system consists of 4 function modules: auto parts sale, auto sale, fix progress and user's hotline. No matter where the user is, he/she can know about the information of production and sales of the factory in real time. For example, one can inquire about the quantity, price, origin of an auto part in warehouse in real time, and also the information about how a specific car's fixed: whether done, now in which procedure, etc. And suggestions, orders can be sent to the No3 factory via this system in real time also.
     Because of introduction of EasyWeb, the existing MIS can integrate with QX_online system without any modification. QX_online system not only accomplished successfully its own commissions to improve sales and promotion and to communicate with customers, but also enlarged the function of existing MIS of No3 factory. At the same time, the construction of QX_online is comparatively easy and fast. It can be maintained by their original Foxpro maintainers.
    
(Note: QX_online system is now under construction.)
     Connecting existing database systems into Web system through middleware is a practical technique not requiring much modification of the databases or Web systems. Also it's a necessary and key point in the construction of an Intranet system.
     The authors hope EasyWeb, a middleware to interconnect Foxpro and Web systems, can do some contribution to the research and construction of Intranet systems.
[1] IETF, the WWW Common Gateway Interface Version 1.1, Feb 15th 1996
[2] Robert B. Denny, Windows CGI 1.3a Interface, Feb 18th 1996