com.HTTPServiceRequest.beginXmlResponse

Starts an HTTP streaming response.

Syntax

beginXmlResponse(
   code INTEGER,
   description STRING )
  RETURNS xml.StaxWriter
  1. code defines the status code of the response.
  2. description defines the description of the response.

Usage

The beginXmlResponse() method starts an HTTP streaming response by sending a status (code) and description (desc), followed by the headers previously set, and returns a xml.StaxWriter object ready to send XML as the HTTP body.

If the request fails to be read, its content will be discarded; for example, when a request is not well formatted.

The default Content-Type header is text/xml, but it can be changed if of the form */xml or */*+xml. For example: application/xhtml+xml.

In HTTP 1.1, if the body size is greater than 32k, the response will be sent in several chunks of the same size.

If the description is NULL, a default description based on the status code is sent.

In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).

The INT_FLAG variable is checked during GWS API call to handle program interruptions, for more details, see Interruption handling in GWS calls (INT_FLAG)