The WebObjects Adaptor

The WebObjects Adaptor provides a flexible interface between a variety of HTTP servers and WebObjects applications. The WebObjects Adaptor consists of two parts, a Web server-side part and a WebObjects application part.

The WebObjectsPro product provides additional WebObjects Adaptor products


WebObjects Adaptor Behavior

The WebObjects Adaptor is started by each new request coming into the server and exits as soon as it has transmitted the corresponding response back. Each time the WebObjects Adaptor wakes, it makes attempts to contact a WebObjects application.

The WebObjects Adaptor attempts to make a connection with a currently-running WebObjects application. If the WebObjects application is not running, the WebObjects Adaptor attempts to autostart the application. If the WebObjects Adaptor does not connect with the WebObjects application, the WebObjects Adaptor fails, returning an error message.

If the WebObjects Adaptor connects to the WebObjects application, it trades information with the WebObjects application using the HTTP protocol, passes HTTP responses containing HTML pages back to the Web server, then exits.


How the WebObjects Adaptor connects

Whenever the Web server receives a URL with /cgi-bin/WebObjects... in it, it awakens the WebObjects Adaptor. (Note that you can change the name of the cgi-bin directory; for example, with the Microsoft IIS Server on NT, the URL contains /Scripts/WebObjects.exe in it.)

The Web server sends the WebObjects Adaptor information found in the URL requests, according to CGI protocol, using environment variables and the stdin() character string. The WebObjects Adaptor uses two configuration files as it begins the process of locating a particular WebObjects application:

If the WebObjects Adaptor fails to connect with a requested WebObjects application, it returns a single error message: "Did not received any response from application." The anonymity of this message helps protect the details of your site from unwanted user inspection. To get details on the cause of failure, you should inspect the WebObjects Adaptor's log file. The exceptions to this one-error-message rule are error messages related to URL syntax.

The WebObjects Adaptor inspects the information it gets from the Web server and attempts to connect with a WebObjects application in the following ways


Autostarting a WebObjects application

By design, when the connection process begins, the WebObjects Adaptor first assumes all WebObjects applications are currently running. If, in the connection process, the WebObjects Adaptor finds a particular WebObjects application is not running, the WebObjects Adaptor may try to automatically start up that application.

The WebObjects Adaptor responds to a URL in a sequence of steps, stopping when it makes a connection. For example, given a request that includes the string
     .../cgi-bin/WebObjects/Examples/myApp
WebObjects performs the following sequence:

  1. Look for the executable <NeXT_Root>/NextLibrary/WebObjects/Executables/Examples/myApp.app/myApp

  2. if not found, look for the executable <NeXT_Root>/NextLibrary/WebObjects/Executables/Examples/myApp.debug/myApp

  3. if not found, look for the executable <NeXT_Root>/NextLibrary/WebObjects/Executables/Examples/myApp/myApp

  4. if not found, look for the executable <NeXT_Root>/NextLibrary/WebObjects/Executables/Examples/myApp

  5. if not found, look for the executable <Document_Root>/WebObjects/Examples/myApp.app/myApp

  6. if not found, look for the executable <Document_Root>/WebObjects/Examples/myApp.debug/myApp

  7. if not found, look for the executable <Document_Root>/WebObjects/Examples/myApp/myApp

  8. if not found, look for the executable <NeXT_Root>/NextLibrary/WebObjects/Executables/EOFDefaultApp

  9. if not found, look for the executable <NeXT_Root>/NextLibrary/WebObjects/Executables/DefaultApp

  10. if not found, return the standard error message.

In the first eight cases, as soon as the executable is found, the application will be started with: myApp -d <Document_Root> Examples/myApp (the last argument represents the path-to-the-application).

In the last two cases, the WebObjects Adaptor also tries to find the following directories

As soon as one of these directories is found, the application will be started with: [EOF]DefaultApp -d <Document_Root>Examples/myApp (the last argument represents the path to the application)


URLs for WebObjects

Generally, a WebObjects application responds to a URL placed in a Web page. The format for a WebObjects application URL is

For example, the Web server may receive a URL requesting a WebObjects application of the form

which reads as

The WebObjects Adaptor prepends the application subpath with the path to the Web server's DocumentRoot, which in this example is

<NeXT_Root>/NextLibrary/WebServer/htdocs/WebObjects/Examples/HelloWorld


The /tmp/logWebObjects and /tmp/CGIMessenger.log files

The WebObjects Adaptor generates a /tmp/CGIMessenger.log file if you create /tmp/logWebObjects. Inspect this file to see a log of the WebObjects Adaptor activities.