(this note taken from the comments at the beginning of _waimodule.c) Python Extension Class interface to Netscape Enterprise WAI API (excerpted from Netscape's documentation, "Chapter 1. Understanding WAI") """ The Web Application Interface (WAI) is one of the programming interfaces that allow you to extend the functionality of Netscape web servers. WAI is a CORBA-based programming interface that defines object interfaces to the HTTP request/response data and server information. Using WAI, you can write a web application in C, C++, or Java that accepts an HTTP request from a client, processes it, and returns a response to the client. You can also write your own server plug-ins for processing HTTP requests. ... WAI includes wrapper classes (classes that implement the interfaces) for C++ and Java and a C interface. You can use C, C++, or Java to write your own applications that access HTTP request objects through the defined interface. ... You can also write server plug-ins in C or C++ that use the functions and classes defined in WAI. """ Anywhere you see "C" in the above sentences, this module lets you add "Python" to the list. ;) v0.1 : Dave Mitchell (davem@magnet.com) 9/30/97 This module implements Netscape's Java WAI interface as documented at http://developer.netscape.com/library/documentation/enterprise/wai/javaapi.htm To learn more about what WAI is and how it works, try looking at: http://developer.netscape.com/library/documentation/enterprise/wai/index.htm To compile this: 1) edit Setup.in to reflect the proper locations the various enterprise libraries, include files, and the ExtensionClass.h header file. 2) edit Makefile.pre.in "NSDIR" variable to point to the directory where enterprise-3.0 is installed 3) you must have ExtensionClass.so in your pythonpath to run the module. 4) type "make -f Makefile.pre.in boot" 5) "make all" 6) If all goes well, you'll now have new copy of python in the current directory, with a builtin "_wai" module. Due to linking errors I was unable to build a working shared waimodule object file. 7) Enable WAI applications in your netsite (it's in the Programs menu of the admin server - If you're using enterprise server 3.0, you'll need to have "osagent" running when you enable WAI or use WAI services) To create a new web application service in Python, you have to do a couple of things: 1) import wai - this is a python layer that provides error tracebacks 2) derive your own class from wai.WebApplicationService, and provide a Run() method which takes as an argument a HTTPServiceRequest object. This HSR object contains methods with which you can query and set request and response headers, as well as getting cgi environment data, and of course, outputting the response to the client. 3) call the WAS object's RegisterService() method, with the argument being the "host:port" of the enterprise 3.0 server you are registering with. 4) Access your wai application via the url "/iiop/" where was the argument given to the WebApplicationService constructor. 5) happy trails! try "./python waihello.py waihello :" and go to the url "/iiop/waihello" for an example. Please do let me know if you do anything cool with this! yours, Dave Mitchell davem@magnet.com