osagent
utility first. You can also use the osfind
utility (provided with 3.0 servers) to troubleshoot problems.
You can install a patch that fixes and improves the WAI programming interface to the Enterprise Server in the following ways:
osagent
is no longer required to be running. For more information on this patch and instructions on how to get it and
install it, go to http://help.netscape.com/filelib.html#wai.
The osagent
and osfind
utilities are no longer included with the 3.01 release of the web server, since the web server no longer requires these utilities to run. The CORBA architecture is a standard developed by the Object Management Group, Inc. (OMG), an international consortium of more than 500 computer industry companies. For more information about CORBA, IDL, or OMG, see the OMG publication entitled The Common Object Request Broker: Architecture and Specification at http://www.omg.org.
Understanding IDL
Interface Definition Language (IDL) is a generic, descriptive language used to define interfaces between client objects and object implementations. An interface described in IDL can be implemented in any language.
WAI describes a set of objects and methods that let you access HTTP requests and server information as well as return results to a browser. The description of WAI is detailed in an Interface Description Language (IDL) specification. IDL is a language that allows you to describe an interface in a generic way and then allows you to compile that specification to a target language such as Java or C++.
Each interface definition specifies the operations that can be performed and the input and output parameters required. For example, the interface definition for an HTTP request describes how clients can access request headers and set response headers.
(The interfaces are defined in *.idl
files, which are located in the server_root
/wai/idl
directory on UNIX and the server_root
\wai\idl
directory on Windows NT.)
Because the interfaces are described in a generic language rather than in a specific programming language, you can use the description of an interface to implement client/server applications in a variety of languages.
WAI Wrapper Classes
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.
For example, one of the methods of the HTTP request interface describes how clients can add a header to the response sent to the client. This method is described in IDL:
Interface described in IDL: HttpServerReturnType addResponseHeader(in string header,
WAI provides wrapper classes in Java and C++ (and a C interface) that implement this interface:
Function call in C:
in string value);NSAPI_PUBLIC WAIReturnType_t WAIaddResponseHeader(ServerSession_t p,
Method in C++:
const char *header, const char *value);WAIReturnType addResponseHeader(const char * header,
Method in Java:
const char * value);public abstract netscape.WAI.HttpServerReturnType addResponseHeader(java.lang.String
In your application or plug-in, you can call these methods to add the response header. The methods (in Java and C++) and C function implement the interface specified in IDL; they share the same parameters (except the C function, which has an additional argument for the server session object) and return the same type of value.
header,java.lang.String value); How Web Application Services Work
Using WAI, you can write a server plug-in or a web application service. For example, you can write a web application service that processes posted data from forms. These web application services work in the following way:
In your application or server plug-in, you define a class derived from the
WAIWebApplicationService
base class provided with WAI.
When writing your application or server plug-in, you register it by calling
the
RegisterService
method of the WAIWebApplicationService
base
class.
You register your application/server plug-in under a unique instance name.
Netscape web servers include a built-in name service that keeps track of
these instance names.
To access a web application service, end users visit URLs in the following
format:
http://server_name:port_number/iiop/service_name
For example, if your server is named
mooncheese
, it is on port 80
, and your
application/server plug-in registers under the name MyWebApp
, users can
access your web application service by visiting the following URL:
http://mooncheese:80/iiop/MyWebApp
The web server invokes the
Run
method of your web application service
class. You write this method to process the incoming HTTP request, retrieve
data from the request, and send a response back to the client.
Last Updated: 12/04/97 16:11:49
Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use