Summary:
See also: The Genero Web Services COM Library
The HTTP Service Request class provides an interface to process incoming XML and TEXT requests over HTTP on the server side, with an access to the HTTP layer and additional XML streaming possibilities.
Note that status is set to zero after a successful method call.
com.HTTPServiceRequest
Object Methods | |
Name | Description |
getURL() RETURNING STRING |
Returns the entire URL request containing the host, port, document and query string. |
getMethod()
RETURNING STRING |
Returns the HTTP method of the request (GET,POST,PUT,HEAD,DELETE) |
getRequestVersion()
RETURNING STRING |
Returns the HTTP version of the request (1.0 or 1.1). |
hasRequestKeepConnection()
RETURNING INTEGER |
Returns whether the request expect the connection to stay open after the sending of the response. |
getRequestHeader( STRING )
RETURNING STRING |
Returns the
value of the request header name, or NULL. Throws an exception in case of errors, and updates status with an error code. |
getRequestHeaderCount()
RETURNING INTEGER |
Returns the number of request headers. |
getRequestHeaderName( INTEGER ) RETURNING
STRING |
Returns the name
of the request header at given position (index is starting at 1). Throws an exception in case of errors, and updates status with an error code. |
getRequestHeaderValue( INTEGER
) RETURNING
STRING |
Returns the
value of the request header at given position (index is starting at 1).
Throws an exception in case of errors, and updates status with an error code. |
readFormEncodedRequest( INTEGER )
RETURNING STRING |
Returns the
query of a POST application/x-www-form-urlencoded
request or the query string of a GET request, decoded according to
HTML4 or XFORM if utf8 is TRUE. Note: If utf8 is TRUE, the decoded query string is translated from utf-8 to the locale charset that might lead to a conversion error. Throws an exception in case of errors, and updates status with an error code. |
readTextRequest()
RETURNING STRING |
Returns the body
of the request as a string. Supported methods are PUT and POST. Note: The request Content-Type header must be of the form text/* as for instance text/richtext. Throws an exception in case of errors, and updates status with an error code. |
readXmlRequest()
RETURNING xml.DomDocument |
Returns the body
of the request as an entire XML document. Supported methods are PUT and
POST. Note: The request Content-Type header must be of the form */xml or */*+xml as for instance application/xhtml+xml. Throws an exception in case of errors, and updates status with an error code. |
beginXmlRequest()
RETURNING xml.StaxReader |
Begins
the streaming HTTP request and returns a xml.StaxReader object ready to
read the XML from the client. Supported methods are PUT and POST. Note: The request Content-Type header must be of the form */xml or */*+xml as for instance application/xhtml+xml. Throws an exception in case of errors, and updates status with an error code. |
endXmlRequest( |
Ends the
streaming HTTP request by closing the StaxReader. Throws an exception in case of errors, and updates status with an error code. |
Object Methods | |
Name | Description |
setResponseVersion( STRING ) |
Sets the HTTP
response version (1.0 or 1.1). Notes:
Throws an exception in case of errors, and updates
status with an error code. |
setResponseCharset( STRING
) |
Sets the charset
to be used when sending XML or Text. Notes:
Throws an exception in case of errors, and updates
status with an error code. |
setResponseHeader( STRING, STRING ) |
Sets or replaces
a header name and value to be
sent in the response. Notes:
Throws an exception in case of errors, and updates
status with an error code. |
beginXmlResponse( INTEGER,
STRING ) RETURNING xml.StaxWriter |
Begins the HTTP
streaming response by sending the given status code
and description, followed by the headers previously
set, and returns a staxWriter ready to send XML as the HTTP body. Notes:
Throws an exception in case of errors, and updates
status with an error code. |
endXmlResponse( |
Ends the HTTP
streaming response by closing the staxWriter. Notes:
Throws an exception in case of errors, and updates
status with an error code. |
sendXmlResponse( INTEGER,
|
Performs the
HTTP response by sending the given status code and description,
followed by the headers previously set, and an entire XML
document as body. Notes:
Throws an exception in case of errors, and updates
status with an error code. |
sendTextResponse( INTEGER,
STRING,
STRING ) |
Performs the
HTTP response by sending the given status code and description,
followed by the headers previously set, and an entire string
as body. Notes:
Throws an exception in case of errors, and updates
status with an error code. |
sendResponse( INTEGER,
STRING
) |
Performs the
HTTP response by sending the given status code and description,
followed by the headers previously set, and without any body. Notes:
Throws an exception in case of errors, and updates status with an error code. |