|
Converter programs |
|
|
Converter programs are primarily for use with application programs that were not originally coded for use with the Web. They can also be used to combine output from several application programs into a single HTTP message. Converter programs are not used when XCICS is an HTTP client, or for Web service processing; they can only be invoked when XCICS is an HTTP server. The role of converter programs in the XCICS Web support process for XCICS as an HTTP server is described in "HTTP request and response processing for XCICS as an HTTP server". A URIMAP definition can invoke a converter program to carry out relevant processing for HTTP requests. If an analyzer program is used in XCICS Web Support processing, the analyzer program can also invoke a converter program. A converter program can be useful in the following circumstances:
If a converter program is invoked directly from a URIMAP definition, the "program" attribute of the URIMAP definition (which specifies the name of the application program to process the request) can be passed to the converter program, and the converter program can choose to override it. The converter program has two functions: Decode The HTTP request is passed to the decode function of the converter program in a 32K block of storage, which is indicated by the user_data pointer in the COMMAREA. It has already been divided into separate elements, such as the method, request headers and body. (Note that if the request is too long to fit into the block of storage, the remainder of the data is not passed to the converter program.) The name of the application program that should handle the request is also supplied, either taken from the URIMAP definition for the request, or set by the analyzer program. If an analyzer program is used, it can provide additional information in a user token. Using this information, the decode function:
Using the COMMAREA returned by the user-written application program, the encode function:
|