21.08.2015 Views

Pro

Serve Up the Web with ITAP - JeffLuther.net

Serve Up the Web with ITAP - JeffLuther.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

providing stubs for different platforms isn’t a problem.Additionally, Pivato told me that he’s currentlyinvestigating Netscape server extensions, so we might seean NSAPI stub in the not-too-distant future, too.The stub reads the HTML file (containing theembedded SALScript to be processed by ITAP), sends it toan application server instance, receives the resultingHTML page (plain HTML now) from it, and returns it tothe Web server to be sent to the client browser. To be ableto do that, the stub has to know which application serverinstances exist and are to be used to handle various ITAPrequests. This is done with an INI file that names eachapplication server instance using an IP address and a portnumber. Additionally, you can configure an error page, atimeout, encryption, and some other parameters using thatINI file. For each virtual server or directory you can havedifferent sections in the INI file, so you can use differentapplication server instances for each. In the main INI fileyou can also redirect a section to a different INI file, so youwould end up with a global INI file in charge of the serveradministrator and an INI file for each virtual server ordirectory in charge of the administrator of the correspondingWeb application. You can even handle ISP situations, whereyou might have a lot of different ITAP Web applicationsserved by one Web server, running on different virtualservers or directories. It might sound a little bit complicated,but it really isn’t; and the ITAP Manager (much like theCentura Connectivity Administrator) can assist you indoing all the necessary configuration.But how did the stub get control of the originalHTML file in the first place? With Internet InformationServer you can register the ITAP’s ISAPI stub (itapisa.dll)to handle requests for files with various extensionsautomatically. Using this feature IIS will pass everyrequest for files named *.itap, (or whatever extensions youchoose) to itapisa.dll (the implementation of the ISAPIstub) for processing. This is exactly like Active ServerPages, where every request for files named *.asp is passedto asp.dll by IIS. The URL for calling my sample sheetlooks like this:http://mydomain/demo.itap(assuming the demo.itap file is placed in the rootdirectory of mydomain). With the CGI stub you couldn’tdo this automatic mapping; the URL for calling mysample sheet would look like this:http://mydomain/scripts/itapcgi.exe?page=demo.itapPlease keep in mind that the first version of ITAP willprobably ship with only the ISAPI stub.A useful class libraryNow you might say, “Looks nice, but real worldapplications aren’t that simple. You need to access thequery string (the part of an URL after the ‘?’), form values,cookies, and you need some session management.” ITAPtakes care of all of these issues. Besides the server stub andthe ITAP engine (a CTD library that has to be included inevery ITAP server application), it comes with a collectionof very useful functional classes. These objects include:• The Request object, to access the HTTP parameters(everything the browser sends to the Web server asdefined by the HTTP).• The Request.Form object, which you’ll use to access allthe parameters that are passed to your page from anHTML Form (it’s very simple;Request.Form.GetString(‘Username’) returns thevalue of an HTML Field named “Username”). If youalready have HTML experience, you can use eitherthe POST or GET method to transfer your form data.In both cases you’ll have access to it via this object.And it also gives you access to parameters that youmanually added to the URL as part of the querystring. This behavior is slightly different from thecorresponding ASP objects.• The Cookie object gives you access to values stored inthe cookie file on the client side.• The Session object lets you store and retrieve variablesthat are persistent during a whole ITAP session. TheITAP session management is cookie-based so itrequires the client to allow a cookie to be set.However, it only stores a unique session ID in acookie, not the session variables themselves, whichare stored in a session file on the server. So you’revirtually unlimited in what you store as sessionvariables.For database access a simple Database object andResultset object are provided, too. All this functionality isavailable either from the server application or from theSALScript embedded in the HTML pages. The sampleapplication shipped with the pre-release is a good place tolearn how to develop Web applications with ITAP.Scalability and fault toleranceScalability and fault tolerance are quite important to Webapplications. You often don’t know how many users yourservices will attract, and you want your application upand running 24 hours, seven days a week in most cases.You can have multiple ITAP server applicationinstances serving one Web application. These serverapplication instances can run on one machine (ondifferent ports) or even on different machines. Thedifferent server instances will be used in a round-robinfashion. If a server application instance fails to respond,www.<strong>Pro</strong>Publishing.comCentura <strong>Pro</strong> October 1999 9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!