uCosminexus Service Platform, Overview
This section describes how HTTP request is processed when HTTP reception is executed.
HTTP request sent by HTTP client is partitioned in the following manner and it is processed in HTTP reception.
In HTTP reception, you can use the message format and definition file to process the request line of HTTP request, HTTP request header, and HTTP request body.
Name space prefix is omitted in the message example described here.
This section describes the request line process of HTTP reception.
You can specify the context root of URL by urecp-http.context-root property of HTTP reception definition file.
If you do not specify urecp-http.context-root property, reception ID of HTTP reception set in the user-defined reception definition screen is used as the context root. For details on HTTP reception definition file, see "HTTP reception definition file" in "Service Platform Reference Guide".
While sending HTTP request, specify URL in the following format:
An example of URL specification is as follows:
http://<Host name or IP address>/Test001/get?type=A&size=7 |
http://<Host name or IP address>/Test002/post |
Operation name refers to HTTP reception operation name set in the user-defined reception definition screen. Operation name is used when a business process is invoked.
If "/" is specified after the operation name and if there is a character string after "/", the part after"/" is also handled as the path. For example, if "http://localhost/contextroot/get/abc123?type=A&size=7" is specified in URL, "/contextroot/get/abc123" is stored as the path in location information (<location>).
URL specified in the request line is partitioned into the following elements and stored in a request message (header):
For example, if the request line is "http://localhost/httprecp/get?type=A&size=7", transformation in the request message is as follows:
<url> <location>/httprecp/get</location> <query>type=A&size=7</query> </url> |
All information in HTTP header part received in HTTP reception is stored in http-header element defined in any type and passed to a business process.
An example of transforming HTTP header part is as follows:
Accept-Language: ja Host: aaa.bbb.ccc.ddd Connection: Keep-Alive Authorization: Basic aG9nZTpmdWdh |
<http-header> <content-type>application/x-www-form-urlencoded; charset=utf-8</content-type> <Accept-Language> ja</Accept-Language> <Host> aaa.bbb.ccc.ddd </Host> <Connection> Keep-Alive</Connection> <Authorization> Basic aG9nZTpmdWdh</Authorization> </http-header> |
You can map XML element of HTTP header part transformed in HTTP reception by HTTP header part of SOAP adapter and any type.
Authorization header field of HTTP request header storing user authentication information is encoded in Base64 format. For this, HTTP reception decodes Authorization header field from Base64 format to plain format and sets in XML element of the request message.
Store the media type of the value of received Content-Type header in the request message (header) as content-type element. At this stage, if there is a charset attribute, store as charset attribute of content-type element.
If there is no Content-Type header, content-type element is not generated. The attribute is not generated if you specify only media type of Content-Type header and there is no charset attribute.
Use charset attribute of Content-Type header as the text data character code of query or form data. If charset attribute of Content-Type header does not exist or if Content-Type header does not exist in the request, processing occurs according to the value of httprecp.http.charset property of HTTP reception definition file. However, in such cases also, charset attribute of content-type element is not generated because there is no charset attribute.
Part classification and data format of HTTP request is processed in HTTP reception in the following manner, according to HTTP request header specification:
HTTP request body process for each data format handled in HTTP reception is described here.
HTTP reception handles parts that do not have filename attribute in Content-Disposition header in query, form data, multi-part type format as text data. In case of handling as text data, after the part is stored in the request message (body) in XML format, it is passed to the business process as a body variable.
If HTTP request data format is only text data format, you can select one of the following modes as the mode of passing message body to a business process:
You can select the mode while passing the message body to a business process in httprecp.switchover.pass-through.mode property of HTTP reception definition file. For details on HTTP reception definition file, see "HTTP reception definition file" in "Service Platform Reference Guide" .
The following table describes an example of transformation of standard mode and pass-through mode:
Table 2-17 Example of transformation of standard mode and pass-through mode
Mode | Description | HTTP request (message body) | Request message after transformation (body) |
---|---|---|---|
Standard mode | Message body is transformed from "key name = value" to "<Key name>Value</Key name>" format. | product1=uCSP&product2=HiRDB%20Single%20Server | <HTTPBody> <product1>uCSP</product1> <product2>HiRDB Single Server</product2> </HTTPBody> |
Pass-through mode | Specify message body part in "msg(fixed)=Value" format.# Value part is set in the request message (body) in XML format as in message body. |
msg=%3cHTTPBody%3e%3cproduct1%3euCSP%3c%2fproduct1%3e%3cproduct2%3eHiRDB%20Single%20Server%3c%2fproduct2%3e%3c%2fHTTPBody%3e | <HTTPBody> <product1>uCSP</product1> <product2>HiRDB Single Server</product2> </HTTPBody> |
In a standard mode, HTTP request is sanitized in HTTP reception during request message transformation and then passed to the business process.
In a pass-through mode, HTTP request is not sanitized. The user must sanitize personally in advance.
If HTTP request part classification is multi-part type and data of the part in which filename attribute of Content-Disposition header exists is partitioned in each part in HTTP reception, the data is stored in the working folder as the intermediate file for each part.
If the data is processed as file data, header information of each part is stored as meta information of the file in the file element of the request message (header) as described in the following table:
Table 2-18 Header information of each part stored in request message (header)
HTTP request header | Header attribute | Optional/Mandatory | Description |
---|---|---|---|
Content-Type | - | Optional | Media type of file specified in each part. You can omit this header. |
char-set | Optional | Character code of file specified in each part. You can omit this attribute. |
|
Content-Disposition#1 | - | Mandatory | Header showing Disposition type. Always specify "form-data".#2 |
name | Mandatory | Attribute showing the name of each part. Always specify this attribute.#3 |
|
filename | Optional | Attribute showing data file name of uploaded file. You can omit this attribute. If you omit this attribute, the data is handled as text data. |
When data of multiple files is uploaded, this meta information is repeated in file element of the request message for each file and then it is stored.
You can set binary data in HTTP request body to send binary format request messages to a business process. You can apply it to process CSV format data in the business process.
To handle the data as binary data in HTTP reception, it is necessary to meet all the following conditions:
Character encoding of binary format request messages is performed during data transformation of the business process.
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.