Resumen del contenido incluido en la página 1
AS/400e
HTTP Server for AS/400 Web
Programming Guide
GC41-5435-04
Resumen del contenido incluido en la página 2
Resumen del contenido incluido en la página 3
AS/400e HTTP Server for AS/400 Web Programming Guide GC41-5435-04
Resumen del contenido incluido en la página 4
Note Before using this information and the product it supports, be sure to read the general information under “Chapter 11. Notices” on page 145. Fifth Edition (May 2000) This edition applies to the IBM HTTP Server for AS/400 licensed program (Program 5769-DG1), Version 4 Release 5 Modification 0 and to all subsequent releases and modifications until otherwise indicated in new editions. This edition applies only to reduced instruction set computer (RISC) systems. This edition replaces GC41-5435-0
Resumen del contenido incluido en la página 5
Contents Search for a Subdirective under Main Directive About HTTP Server for AS/400 Web (QzhbFindSubdirective) API........49 Programming Guide (GC41-5435).... v Return Details of a Main Directive or Conventions in this book ..........v Subdirective (QzhbGetDirectiveDetail) API . . . 51 AS/400 Operations Navigator ........v Add a Main Directive or Subdirective Installing Operations Navigator.......vi (QzhbAddDirective) API.........52 Prerequisite and related information ......vi Remove a Main Di
Resumen del contenido incluido en la página 6
Overview of Persistent CGI.........81 HTTPreturncodesandvalues.......113 Named Activation Groups ........81 Predefined functions and macros......114 Accept-HTSession CGI Header.......81 Returncodes ............119 HTTimeoutCGIHeader .........82 Server API configuration directives......120 Considerations for using Persistent CGI ServerAPIusagenotes.........120 Programs..............82 Server API directives and syntax......120 Persistent CGI Program Example ......83 Server API directive variables.
Resumen del contenido incluido en la página 7
About HTTP Server for AS/400 Web Programming Guide (GC41-5435) The web is an interactive medium. For example, it allows users to use search utilities to locate information on a topic, give feedback to a company about its products, and more. The IBM HTTP Server software does not perform these tasks. They are performed by external programs using information passed to them by the server. The HTTP Server for AS/400 Web Programming Guide tells you how to write external programs that interact with the
Resumen del contenido incluido en la página 8
recommends that you use AS/400 Operations Navigator, which has online help to guide you. While this interface is being developed, you may still need to use an emulator such as PC5250 to do some of your tasks. Installing Operations Navigator To use AS/400 Operations Navigator, you must have Client Access installed on your Windows PC. For help in connecting your Windows PC to your AS/400 system, consult Client Access Express for Windows - Setup, SC41-5507-01. AS/400 Operations Navigator is a separ
Resumen del contenido incluido en la página 9
– RCHCLERK@us.ibm.com Be sure to include the following: v The name of the book. v The publication number of the book. v The page number or topic to which your comment applies. About HTTP Server for AS/400 Web Programming Guide (GC41-5435) vii
Resumen del contenido incluido en la página 10
viii Web Programming Guide V4R5
Resumen del contenido incluido en la página 11
Chapter 1. Writing Common Gateway Interface Programs OverviewoftheCGI ...........1 Parsing..............12 CGI and Dynamic Documents .......2 Datamanipulation..........12 UsesforCGI .............3 Response generation .........12 The CGI process.............3 Environment variables...........13 Overview ..............3 Requests from Standard Search (ISINDEX) SendingInformationtotheServer ......5 Documents .............15 Data Conversions on CGI Input and Output . . . 5 Passing SSL Environment Vari
Resumen del contenido incluido en la página 12
The functions and tasks that CGI programs can perform range from the simple to the very advanced. In general, we call those that perform the simple tasks CGI scripts because you do not compile them. We often call those that perform complex tasks gateway programs. In this manual, we refer to both types as CGI programs. Given the wide choice of languages and the variety of functions, the possible uses for CGI programs seem almost endless. How you use them is up to you. Once you understand the CGI
Resumen del contenido incluido en la página 13
Uses for CGI HTML allows you to access resources on the Internet by using other protocols that are specified in the URL. Examples of such protocols are mailto, ftp, and news. If you code a link with mailto that is followed by an e-mail address, the link will result in a generic mail form. What if you wanted your customers to provide specific information, such as how often they use the web? Or how they heard about your company? Rather than using the generic mailto form, you can create a form that
Resumen del contenido incluido en la página 14
The following HTML form illustrates the various types of fields: Note: The CGIXMP.EXE program referred to in this sample is just an example; it is not shipped with the server product.
CGIXMP Test Case CGISample Test Case
Fill in the following fields and press APPLY. The values you enter will be read by the CGIXMP.EXE program and displayed in a simple HTML form which is generated dynamically by the program.
Sending Information to the Server When you fill out a form, the web browser sends the request to the server in a format that is described as URL-encoded. The web
Resumen del contenido incluido en la página 16
back to the browser. You must provide data to a CGI program through environment variables and standard-input (stdin). HTTP and HTML specifications allow you to tag text data with a character set (charset parameter on the Content-Type header). However, this practice is not widely in use today (although technically required for HTTP1.0/1.1 compliance). According to this specification, text data that is not tagged can be assumed to be in the default character set ISO-8859-1 (US-ASCII). AS/400 corre
Resumen del contenido incluido en la página 17
In this mode, the server will convert everything into the EBCDIC CCSID of the job. The server checks the Entity bodies for a charset tag. If found, the server will convert the corresponding ASCII CCSID to the EBCDIC CCSID of the job. If the server does not find a charset tag, it uses the value of the DefaultNetCCSID configuration directive as the conversion CCSID. In addition, the system converts escaped octets from ASCII to EBCDIC, eliminating the need to perform this conversion in the CGI prog
Resumen del contenido incluido en la página 18
Using the EBCDIC_JCD mode: The EBCDIC_JCD mode determines what character set is being used by the browser for a given request. This mode is also used to automatically adjust the ASCII/EBCDIC code conversions used by the web server as the request is processed. After auto detection, the %%EBCDIC_JCD%% mode converts the stdin and QUERY_STRING data from the detected network CCSID into the correct EBCDIC CCSID for Japanese. The default conversions configured for the server instance are overridden. Th
Resumen del contenido incluido en la página 19
Notes: 1. If startup NetCCSID is 932 or 942, detected network, Shift JIS’s CCSID is the same as startup NetCCSID. Otherwise, Shift JIS’s CCSID is 943. Startup NetCCSID Shift JIS (JCD detected CCSID) ---------------- ------------------------------ 932 932 942 942 943 943 5052 943 5054 943 5050 943 2. Netscape Navigator 3.x sends the alphanumeric characters by using JIS X 0201 Roman escape sequence (CCSID 5052) for ISO-2022-JP. Netscape Communicator 4.x sends the alphanumeric characters by using A
Resumen del contenido incluido en la página 20
%%MIXED%% In this mode HTTP header output is in CCSID 37. However, the escape sequence must be the EBCDIC representative of the ASCII code point for the 2 characters following the ″%″ in the escape sequence. An example of a HTTP header that may contain escape sequences is the Location header. %%EBCDIC%% In this mode HTTP header output is in CCSID 37. However, the escape sequence must be the EBCDIC representative of the EBCDIC code point for the 2 characters following the ″%″ in the escape sequen