uCosminexus Service Platform, Overview
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.
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). |
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-Length: 51 Content-Type: image/gif Last-Modified: Fri, 21 Jul 2006 07:51:32 GMT Accept-Ranges: bytes Server: Microsoft-IIS/6.0 Date: Mon, 16 Jul 2012 09:43:57 GMT |
<http-header-response> <http-header> <Content-Length>51</Content-Length> <Content-Type>image/gif</Content-Type> <Last-Modified>Fri, 21 Jul 2006 07:51:32 GMT</Last-Modified> <Accept-Ranges>bytes</Accept-Ranges> <Server>Microsoft-IIS/6.0</Server> <Date>Mon, 16 Jul 2012 09:43:57 GMT</Date> </http-header> </http-header-response> |
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. |
Only the following values are the elements stored in the response message (header). All other values are ignored.
HTTP response body is handled in the following manner depending on whether Content-Disposition header is specified in HTTP response header:
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. |
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)
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.
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.
The following figure shows the status code processing flow:
Figure 2-89 Status code processing flow
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:
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".
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.