Page 418
If chunkSize ub4 has a non-zero value, the size of the request response in bytes will be restricted to this value. In such situations, you'll need to invoke the WRB_ICXfetchMoreData() method repeatedly until you've received the entire response. If ub4 chunkSize is zero, no data is returned. If ub1 sendToBrowser is non-zero, WRB will send the response directly to the originating browser; in this case, the response parameter will contain NULL on return.
WRB_ICXsetAuthInfo()This method sets the authentication header data to accompany the specified request (see Listing 17.13).
Listing 17.13 Setting the Authorization Header for a Specific Request with WRB_ICXsetAuthInfo()
WAPIReturnCode WRB_ICXsetAuthInfo(void *WRBCtx, dvoid * hRequest, text *username, text *password, text *realm); Parameters Return Values WRB_ICXsetAuthMethod() returns a value of type WAPIReturnCode.
If your cartridge issues requests to another cartridge that in turn requires that your cartridge authenticate itself, you should invoke the WRB_ICXsetAuthInfo() method. Doing so sets the authentication header data per request to the other cartridge.
*WRBCtx is a pointer to the opaque WRB context object that the WRB application engine passed to your cartridge method. dvoid * hRequest identifies the request for which authentication is to be established. WRB_ICXcreateRequest() returns this handle. text * username is a pointer to a user name for request authentication. The user name must be defined in the specified realm. text * password points to the password for the username. text * realm points to the name of the authentication realm that defines the username.
WRB_ICXsetContent()WRB_ICXsetContent() sets request content for a specified request (see Listing 17.14).
Listing 17.14 Setting Content Data for a Specific Request with WRB_ICXsetContent()
WAPIReturnCode WRB_ICXsetContent(void *WRBCtx, dvoid * hRequest, WRBpBlock hPBlock); Parameters Return Values WRB_ICXsetContent() returns a value of type WAPIReturnCode.
Page 419
To establish content data for a particular request, perform the following steps:
*WRBCtx points to the opaque WRB context object that the WRB application engine passed to your cartridge function. dvoid * hRequest identifies the request for which content is to be specified. This should be a handle returned by WRB_ICXcreateRequest(). WRBpBlock hPBlock represents the parameter block containing the request content.
WRB_ICXsetHeader()WRB_ICXsetHeader() is responsible for setting HTTP header data for a specified request (see Listing 17.15).
Listing 17.15 Setting Headers for a Specific Request with WRB_ ICXsetHeader()
WAPIReturnCode WRB_ICXsetHeader(void *WRBCtx, dvoid * hRequest, WRBpBlock hPBlock, boolean useOldHdr); Parameters Return Values WRB_ICXsetHeader() returns a value of type WAPIReturnCode.
Invoking this method requires certain calls having been made first. The sequence of calls involved are as follows:
*WRBCtx points to the opaque WRB context object that the WRB application engine passed to your cartridge function. dvoid * hRequest identifies the request for which headers are to be set. WRB_ICXcreateRequest() returns the dvoid * hRequest handle. WRBpBlock * hPBlock represents the parameter block that contains the header information. If boolean useOldHdr is set to TRUE, the ICX request incorporates header data from the original request, in addition to the data defined by the parameter block. If useOldHdr is FALSE, only header data from the parameter block is used.
WRB_ICXsetMethod()WRB_ICXsetMethod() is responsible for setting the request method, such as GET or POST, for a specified request (see Listing 17.16).
Page 420
Listing 17.16 Setting the HTTP Method to Use in a Specific Request with WRB_ICXsetMethod()
WAPIReturnCode WRB_ICXsetMethod(void *WRBCtx, dvoid * hRequest, WRBMethod method); Parameters Return Values WRB_ICXsetMethod() returns a value of type WAPIReturnCode.
The assumption here is that you invoked the WRB_ICXcreateRequest() method to create a request. Invoke WRB_ICXsetMethod() to specify a request method for the request. The default request method is GET.
*WRBCtx points to the opaque WRB context object that the WRB application engine passed to your cartridge function. dvoid * hRequest identifies the request for which the method is to be set. WRB_ICXcreateRequest() returns this handle.
WRB_ICXsetMethod() takes an argument of type WRBMethod that represents the request method to be used for a request (see Listing 17.17).
Listing 17.17 The WRBMethod Enumerated Type
typedef enum _WRBMethod { OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE } WRBMethod;
For more information on this enumerated type, refer to your documentation on Web Request Broker.
WRB_ICXsetNoProxy()This method builds a list of DNS domains for which the proxy server (specified by WRB_ICXsetProxy()) shouldn't be used. This ensures that any request URLs originally intended for the given proxy server are rejected. Listing 17.18 shows how to implement this method.
Listing 17.18 Specifying Domains for Which the Proxy Server Shouldn't Be Used with WRB_ICXsetNoProxy()
WAPIReturnCode WRB_ICXsetNoProxy(void *WRBCtx,
Page 421
text *noProxy); Parameters Return Values WRB_ICXsetNoProxy() returns a value of type WAPIReturnCode.
If your cartridge calls WRB_ICXsetProxy() to set up proxy server request translation but you don't want requests to all DNS domains to use the proxy server, use WRB_ICXsetNoProxy() to specify a comma-separated list of domains to which requests should be sent directly, without proxy server intervention.
*WRBCtx points to the opaque WRB context object that the WRB application engine passed to your cartridge function. *noProxy points to a comma-separated list of DNS domains to which requests should be sent directly.
WRB_ICXsetProxy()This method tells cartridges which proxy server to use in making future ICX requests that must be routed outside a firewall. Listing 17.19 shows how to specify a proxy server.
WAPIReturnCode WRB_ICXsetProxy(void *WRBCtx, text *proxyAddress); Parameters Return Values WRB_ICXsetProxy() returns a value of type WAPIReturnCode.
Invoking this method is useful when your intranet-based cartridge needs to dispatch ICX requests to servers outside the firewall. The cartridge would reference the address set by this method.
*WRBCtx points to the opaque WRB context object that the WRB application engine passed to your cartridge function. *proxyAddress represents the proxy address in character-string form.
With the PL/SQL Agent, you can develop your Web applications by using Oracle7x stored procedures. The assumption here is that these stored procedures are written in Oracle's native SQL language, PL/SQL. For non-Oracle databases, you'll have to acquire a third-party ODBC cartridge or develop one yourself. Oracle, however, assures its customers that interacting with database objects is much easier in PL/SQL than any other language. Quite obviously, because Web Application Server is more mature with Oracle databases, your safest bet for portability and scalability issues is to incorporate PL/SQL.
The PL/SQL Agent shares a similarity with its sister, the Web Agent, which was discussed briefly earlier. Both agents allow your development staff to build data-driven, dynamic HTML pages with customized content by using Oracle7x stored procedures. In terms of speed, the