Table of Contents Previous Next PDF


Oracle SALT HTTP FML32 Buffer Format

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.
 
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.
 
 

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.