uCosminexus Service Platform, Overview

[Contents][Glossary][Index][Back][Next]

2.14.4 Relation between HTTP responses and response messages

This section describes the mechanism for transformation from HTTP response of HTTP adapter to the response message.

HTTP response returned from the server is processed for each of the following elements and stored in the response message:

Details of each item are as follows:

Name space prefix is omitted in the message example described here.

Organization of this subsection
(1) Status line
(2) HTTP response header
(3) HTTP response body
(4) Setting normal process or fault process in status code
(5) Setting restriction on response size
(6) Automatic deletion of incomplete received files

(1) Status line

Status line element of HTTP response is stored in the response message as described in the following table:

Table 2-37 Correspondence between status line and response message

Status line element Correspondence with response message
HTTP version Not stored in response message.
Status code Stored in status-code element of response message (header).#
Reason phrase Stored in reason-phrase element of response message (header).

Note#
Status codes other than 200 are system exceptions by default. However, you can also set to return faults as normal process or fault response in other than 200. For details, see "(4) Setting normal process or fault process in status code".

(2) HTTP response header

All HTTP headers received in HTTP adapter are stored in http-header element of the response message (header). If HTTP headers with identical names overlap and are received, they are stored in the same state as multiple elements.

An example of HTTP response header and the corresponding response message (header) is as follows:

Content-Type header and Content-Disposition header of HTTP response header are also stored in the following elements of the response message (header):

Table 2-38 Mapping of Content-Type header, Content-Disposition header and response message (header)

HTTP response header Attribute Elements stored in response message (header)
Content-Type - Media type part (*/*) of Content-Type header field is stored in http-header-Content-Type element.
charset Attribute value is stored in charset attribute of http-header-Content-Type element. Not stored if there is no specification in charset attribute.
Content-Disposition - HTTP response is handled as file data if there is specification in HTTP response. Disposition type value is ignored.
filename Value is stored as filename element of the child element of file element. Specified value is not transformed for decoding.

Legend:
-: Not applicable.

Only the following values are the elements stored in the response message (header). All other values are ignored.

(3) HTTP response body

HTTP response body is handled in the following manner depending on whether Content-Disposition header is specified in HTTP response header:

(a) File data

To receive file data, you must specify the output destination directory in the request message (header), HTTP-adapter runtime-environment property file or HTTP-adapter runtime-environment common property file. You can use only a common folder to specify in the property file.

The following table describes the specification location of file data in the request message (header), HTTP-adapter runtime-environment property file, and HTTP-adapter runtime-environment common property file:

Table 2-39 Specification location of file data

Specification method Specified element or property Description
Request message (header) common attribute of request-id element Set request ID for the working folder. You can omit this if the working folder is not used.
output-folder-name element Specify either the common folder or the working folder as the file data output destination.
output-folder-name element Specify common folder definition name to output file data. You can omit specification, if the working folder is used.
HTTP-adapter runtime-environment property file, HTTP-adapter runtime-environment common property file adphttp.request.output-folder-name property Specify common folder definition name to output file data.

If the output destination directory is not specified in the request message (header), HTTP-adapter runtime-environment property file or HTTP-adapter runtime-environment common property file, an error occurs.

Information such as output destination directory, output file name is stored in the response message (header).

The following table describes file information stored in the response message (header):

Table 2-40 File information stored in response message (header)

Response message (header) element Description
common attribute of output-folder-name element Common folder or working folder is stored as folder type used to output file data.
output-folder-name element Definition name of folder that is used to output file data is stored. If output is in common folder, common folder definition name is stored. If output is in working folder, it is always blank (blank character string).
file-name element Value of filename attribute of Content-Disposition header specified in HTTP response is stored. However, processes such as decoding do not occur in HTTP adapter. If filename attribute is omitted, element is not generated.
local-file-name element Name of the intermediate file saved in the output destination folder is stored.

Note 1
The file name output in the common folder by HTTP adapter consists of unique ID numbered in the system. Please note the following points:
  • Avoid occurrence of return of time, since server time stamp is used for generating unique ID. If you use NTP software to revise the time, always use slew mode. For details on points to be considered when revising time, see "1.4 Determining the operations policy" in "Service Platform System Setup and Operation Guide" .
  • Design the system so that these names and their combinations are not duplicated when same common folders are accessed from multiple HCSC servers, since HCSC server name and cluster name are used for generating unique ID.
    Even if HCSC server is in load balance cluster configuration or HA cluster configuration, you must avoid duplication of HCSC server name and cluster name combinations in each HCSC server.
    Example: If HCSC server name of HCSC server 1=HCSC1, cluster name=CLS1
    [Figure]HCSC server name of HCSC server 2=HCSC1, cluster name=CLS1 ? duplicated
    [Figure]HCSC server name of HCSC server 2=HCSC2, cluster name=CLS1 ? not duplicated
    [Figure]HCSC server name of HCSC server 2=HCSC1, cluster name=CLS2 ? not duplicated
    [Figure]HCSC server name of HCSC server 2=HCSC2, cluster name=CLS2 ? not duplicated
If you cannot meet the above conditions, use only a working folder. If you use a common folder, file name might be duplicated and the file might be overwritten.

Note 2
While using a common folder in the file data output destination, always use the exclusive common folder used only by HTTP adapter. Do not share with common folders used for other usage.

The following figure shows an example of file reception using HTTP adapter:

Figure 2-88 Example of file reception using HTTP adapter (if common folder is used)

[Figure]

(b) Raw data (pass-through mode)

To store HTTP response body data in HTTP adapter response message (body) as is, the user must create an optional message format of the response message (body).

If required, you can also process the received data by invoke java activity, component-common UOC.

(4) Setting normal process or fault process in status code

In HTTP adapter, you can perform settings set to handle the status code specified during HTTP response as normal processing or fault processing.

You can set details in HTTP adapter definition file about which status codes are to be handled as normal processing and as fault processing.

Table 2-41 Settings related to status code processing

Property name Description
adphttp.response-code.normal Specify status code to be handled as normal processing using regular expression. Default is 200.
adphttp.response-code.fault Specify status code to be handled as fault processing using regular expression. Default is a null string.

If the status code does not fully match with the regular expression, it is processed as a system exception, since the status code is not returned in HTTP response.

Note
You can cache in the business process to handle as fault processing. However, you cannot re-execute. Therefore, while setting fault processing, consider the effects on the business process and then set.

The following figure shows the status code processing flow:

Figure 2-89 Status code processing flow

[Figure]

(5) Setting restriction on response size

In HTTP adapter, to control insufficient memory and disk pressure when an extremely large HTTP response is received, you can set threshold value of HTTP response body size and control the reception size.

You can set threshold value of HTTP response body size in HTTP adapter definition file. The properties to be set are as follows:

Table 2-42 Setting threshold value of HTTP response body size

Item Property name
Maximum size of data permitted while setting HTTP response in pass-through mode in the response message (body) adphttp.data-size-limit.body-message
Maximum size of data permitted while writing HTTP response in files adphttp.data-size-limit.file

After setting threshold value, response size is determined in the following order in HTTP adapter:

  1. If HTTP header contains Content-Length header, determine whether header field value exceeds the threshold value. If threshold value is exceeded, a system exception occurs immediately without receiving HTTP response body.
  2. If HTTP header does not contain Content-Length header (if chunk encoded data is received), HTTP response body reception is processed, reception process breaks down at the point when threshold value is exceeded and a system exception occurs.

(6) Automatic deletion of incomplete received files

If a problem such as network failure, I/O error, excess of data size limit occur while receiving a file in HTTP adapter, an incomplete received file is generated in the common folder and working folder. However, this incomplete received file can be deleted automatically.

You can set this functionality in adphttp.auto-delete-incomplete-file property of HTTP adapter definition file.

If deletion of incomplete received files fails, message log (KDEC81403-W) is output. In such cases, files which failed to be deleted need to be deleted manually. For deletion methods, see "5.4.20 Deleting working folders" and "5.4.22 Deleting files in the common folder" in "Service Platform System Setup and Operation Guide".