Reference Guide

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Oracle SALT HTTP FML32 Buffer Format

The following section(s) provide Oracle SALT HTTP FML32 Buffer Format information:

 


Oracle SALT HTTP FML32 Buffer Format

Oracle Tuxedo services may be developed to generate dynamic HTML content.These services are sent data in a specific FML32 format, and must return responses in another FML32 buffer as shown in Listing H-1

Listing H-1 Oracle SALT HTTP FML32 Buffer Format
#include <atmi.h>
#include <userlog.h>
#include <fml32.h>
#include <httpflds.h> /* contains the HTTP field definitions */
/**
 * MyService. Must match the TuxService parameter
 * configured in mod_tuxedo 
 */
MyService(TPSVCINFO *rqst) {
    FBFR32 *response_buf;
    int rc;
    char *query_string;
    long query_len;
    char *response_body = "<html>\n<head>\n<title>Tuxedo"         
                          "Test</title>\n</head>\n<body>\n"
                          "<p>Hello World</p>\n</body>\n<html>";
    query_string = malloc(QUERY_SIZE);
    if (query_string == NULL) {
        userlog("Unable to allocate query_string: %d", errno);
        tpreturn(TPFAIL, 0, NULL, 0L, 0);
    }
    rc = Fget32(rqst->data, QUERY_STRING, 0, 
                (char*)query_string, 
                &query_len);
    if (rc < 0) {
        userlog("Problem extracting query_string: %s", 
                Fstrerror32(Ferror32));
        tpreturn(TPFAIL, 0, NULL, 0L, 0);
    }
    userlog("QUERY_STRING received: %s", query_string);
    if((response_buf = 
        (FBFR32 *) tpalloc("FML32", NULL, 1024 )) == NULL) {
        userlog("Unable to allocate response_buf:%s", 
                 tpstrerror(tperrno));
        tpreturn(TPFAIL, 0, NULL, 0L, 0);
    }
    if((response_data = 
        tpalloc("CARRAY", NULL, strlen(response_body) + 1) == NULL) {
        userlog("Unable to allocate response_buf:%s", 
                tpstrerror(tperrno));
        tpreturn(TPFAIL, 0, NULL, 0L, 0);
    }
    strcpy(response_data, response_body);
    rc = Fchg32(response_buf, RESPONSE_DATA, 0, 
                (char*)respone_data, 
                0);
    if (rc < 0) {
        userlog("Problem setting response data: %s", 
                Fstrerror32(Ferror32));
        tpreturn(TPFAIL, 0, NULL, 0L, 0);
    }
    tpreturn(TPSUCCESS, 0, (char *)response_buf, 0L, 0);
}

Input Buffers

Upon invocation by mod_tuxedo, an Oracle Tuxedo service receives an FML32 buffer as listed in Table H-1.

Table H-1 Input Buffers
Field Name
Description
Type
AUTH_TYPE
Describes the authentication method used by the web browser if any authentication method was used. This is not present unless security is used.
string
CONTENT_TYPE
Tells the media type of data being received from the user. This is used for requests performed using the POST method, and not present otherwise.
string
DOCUMENT_ROOT
The root path to the home HTML page for the server. Example:
/home/httpd/html
string
PATH_INFO
Extra path information added to the end of the URL that accessed the server side script program.
string
PATH_TRANSLATED
A translated version of the PATH_INFO variable translated by the webserver from virtual to physical path information.
string
QUERY_STRING
<A HREF="/cgi-bin/hits.pl?mainpage></A>
The information after the ? is the QUERY_STRING which is "mainpage" in this case. In this case QUERY_STRING will contain:
mainpage
string
REMOTE_ADDR
The IP address of the client computer. Example:
132.15.28.124
string
REMOTE_HOST
The fully qualified domain name of the client machine making the HTTP request. It may not be possible to determine this name since many client computers names are not recorded in the DNS system. Example:
myhost.mycompany.com
string
REMOTE_IDENT
The ability to use this field is limited to servers that support RFC 931. This field may contain the client machine's username, but it is intended to be used for logging purposes only, when it is available.
string
REMOTE_PORT
The clients requesting port. An example:
3465
string
REMOTE_USER
If security is enabled and the user had to be logged in to get access to the service, this value will contain the user's log in name.
string
REQUEST_URI
The path of the request sent by the client. An example:
/tux/processorder?orderId=1234
string
REQUEST_METHOD
This describes the request method used by the browser which is normally GET, POST, or HEAD.
string
SERVER_ADMIN
The e-mail address of the server administrator. Example:
webadmin@myhost.mycompany.com
string
SERVER_NAME
The server hostname, IP address or DNS alias name shown as a self referencing URL. This does not include the protocol identifier such as "HTTP:", the machine name, or port number. Example:
myhost
string
SERVER_PORT
The port number the HTTP requests and responses are being sent on. Example:
80
string
SERVER_PROTOCOL
This value is normally HTTP which describes the protocol being used between the client and server computers. Example:
HTTP/1.1
string
SERVER_SIGNATURE
Server information specifying the name and version of the web server and the port being serviced. Example:
Apache/2.2.15 Server at myhost Port 80
string
SERVER_SOFTWARE
The name and version of the web server. Example:
Apache/2.2.15 (Unix) mod_fastcgi/2.4.6 mod_tuxedo/1.0.0
string
HTTP_ACCEPT
The media types of data that the client browser can accept. These data types are separated by commas. An example:
image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*
string
HTTP_ACCEPT_ENCODING
An example:
gzip, deflate
string
HTTP_ACCEPT_LANGUAGE
The language the client browser accepts. Example:
en-us
string
HTTP_COOKIE
Used as an environment variable that contains cookies associated with the server domain from the browser.
string
HTTP_FORWARDED
For example:
by http://proxy.yourcompany.com:8080 (Netscape-Proxy/3.5)
string
HTTP_HOST
For example:
yourhost.yourcompany.com
string
HTTP_PRAGMA
For example:
No-Cache
string
     
HTTP_REFERRER
The page address where the HTTP request originated.
string
HTTP_USER_AGENT
The name of the client web browser being used to make the request. Example:
Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.307.11
string
POST_DATA
For POST requests, the data as it was sent by the client browser. The data is url-encoded. Example:
Name=Jonathan+Doe&Age=23&Formula=a+%2B+b+%3D%3D+13%25%21
carray

Output Buffers

An Oracle Tuxedo server called by mod_tuxedo must return an FML32 buffer containing the fields described in Table H-2 . Returning a buffer of any other type, or missing any of the mandatory fields results in a server error being returned to the client browser.

Table H-2 Output Buffers
Field Name
Description
Type
RESPONSE_CODE*
Numeric code corresponding to the status string to return to the client.
Examples: 200 or 404 or 302.
This field is mandatory.
long
STATUS_LINE
String version containing the complete status string to return to the client.
Examples:
200 OK
302 FOUND
This field is optional.
String
CONTENT_TYPE
Gives the MIME-type of the data in the body, such as text/html or image/gif.
A typical value is text/html, but programs may generate images and return image/gif contents.
If not specified, a text/html header is generated and returned.
string
HTTP_COOKIE
Corresponds to the Set-cookie header. May contain cookie data. For example, session ids may be set using this field.
Example contents:
sessionid=bbdb4cd00829aa5ffb5402395cb8f8c0; expires=Fri, 18-Mar-2011 19:39:19 GMT; Max-Age=1209600; Path=/
This field is optional.
string
LOCATION
Usually used in conjunction with '302 FOUND' response codes, contains the location of the redirect url.
Example:
http://123.456.1.123:2280/admin/
This field is mandatory if a '302 FOUND' response is returned.
string
RESPONSE_DATA*
The data that will be returned to the client browser or program, excluding headers. Proper headers are handled and generated by mod_tuxedo. For example:
<html>
<head>
<title>Tuxedo Test</title>
</head>
<body>
<p>Hello World</p>
</body>
<html>
carray


  Back to Top       Previous  Next