uCosminexus Service Platform, Overview
This subsection describes the mechanism to transform from HTTP adapter request message to HTTP request.
Request messages passed from the business process are partitioned in the following manner in HTTP adapter and transformed to HTTP requests:
HTTP request setting methods and details of each item are described here.
Name space prefix is omitted in the message example described here.
HTTP request is set in the following locations for each HTTP request configuration element:
Set the request line and request header by using any location from the above 3 setting locations (You can use single locations and multiple location combinations also). Set the request body by using the request message (body) or the files in the working folder and common folder.
Figure 2-83 Example of setting HTTP request
Set the request line and request header in 3 locations, namely request message (header), HTTP-adapter runtime-environment property file, and HTTP-adapter runtime-environment common property file. If they are set in multiple locations, HTTP adapter is used as high priority setting and processed.
The following table describes the priority of each setting location:
Table 2-31 Request line and request header setting locations and priorities
Priority | Setting location | |
---|---|---|
High | Priority 1 | Request message (header) |
| | Priority 2 | HTTP-adapter runtime-environment property file |
Low | Priority 3 | HTTP-adapter runtime-environment common property file |
HTTP request setting is enabled in parameter units in each property file in the request message (header) and each property file (each element in the request message (header) and individual properties in the property file).
Each setting location contains the following features. Reduction in development efforts and easy operations are planned by matching system requirements and combining suitably.
Table 2-32 Setting locations and features of request line and request header
Setting location | Features |
---|---|
Request message (header) | Suitable for parameter definitions required to dynamically change value of each request because setting is enabled during HTTP adapter execution. (Example) Request method and URI specification. |
HTTP-adapter runtime-environment property file | Suitable for parameter settings decided statically during adapter development (or during operation) because fixed parameters can be set for each definition of HTTP adapter. (Example) Specification of output destination folder during file reception (download). |
HTTP-adapter runtime-environment common property file | Suitable for setting common static parameters in the system because common parameters can be set in all HTTP adapters. (Example) Specification of output destination of authentication information and log files. |
Figure 2-84 Example of setting HTTP request (issuing HTTP request that is always fixed)
Figure 2-85 Example of setting HTTP request (sharing some settings between multiple HTTP adapters)
You can reduce development efforts by such setting methods because common parameters need not be defined in duplicate. Also, setting confirmation and change operations (in this example, setting change operation of HTTP adapter according to update of authentication information in service 1) become easy, since common parameters are uniformly managed in 1 property file.Figure 2-86 Example of setting HTTP request (dynamically setting HTTP request contents)
Specify the request body in pairs of data stored in the request body and data sending types (data storage method). Set each in the following locations:
Files in request message (body) or working folder and common folder are transformed to a suitable form according to the data sending type, stored in the request body and then issued as requests. The following figure shows setting image when a request body is issued:
For specific setting items and setting methods, see "(4) HTTP request body".
For details on elements you can set in the request message (body), see "3.3.13 Defining HTTP adapters" in "Service Platform Reception and Adapter Definition Guide" .
The request line described in the first line of HTTP request is sent in the following format:
HTTP methodAURIAProtocol# |
HTTP methods and URI specification methods are described here.
Specify HTTP method of the request line in the request message (header), HTTP-adapter runtime-environment property file and HTTP-adapter runtime-environment common property file.
The following table describes the specification locations of HTTP methods:
Table 2-33 Specification locations of HTTP methods
Specification method | Item | Specification location |
---|---|---|
Request message (header) | HTTP method | method element |
HTTP-adapter runtime-environment property file, HTTP-adapter runtime-environment common property file | HTTP method | adphttp.request.method property |
If you cannot specify HTTP method in the request message (header), HTTP-adapter runtime-environment property file or HTTP-adapter runtime-environment common property file, an error occurs.
Partition the request line URI into scheme authority, path, and query and then specify these in the request message (header), HTTP-adapter runtime-environment property file and HTTP-adapter runtime-environment common property file.
The following table describes specification locations of URI:
Table 2-34 Specification locations of URI
Specification method | Item | Specification location |
---|---|---|
Request message (header) | Scheme authority | uri-scheme-authority element |
Path | uri-path element | |
Query | uri-query element | |
HTTP-adapter runtime-environment property file, HTTP-adapter runtime-environment common property file | Scheme authority | adphttp.request.uri-scheme-authority property |
Path | adphttp.request.uri-path property | |
Query | adphttp.request.uri-query.<Additional number> property |
If scheme authority and path are not specified in the request message (header), HTTP-adapter runtime-environment property file or HTTP-adapter runtime-environment common property file, an error occurs.
If you specify "https" in the scheme part of the scheme authority, use HTTPS to communicate. However, setting is required to use HTTPS. For details, see "Appendix I Security settings required security in the HTTP adapter" in "Service Platform Reception and Adapter Definition Guide" .
An example of URI specification is as follows. The generated URI in both cases is "http://localhost:80/test/selectdata?name=sample&id=001".
<http-header-request> <uri-scheme-authority>http://localhost:80</uri-scheme-authority> <uri-path>/test/selectdata</uri-path> <uri-query> <name>sample</name> <id>001</id> </uri-query> </http-header-request> |
adphttp.request.uri-scheme-authority=http://localhost:80 adphttp.request.uri-path=/test/selectdata adphttp.request.uri-query.1=name=sample adphttp.request.uri-query.2=id=001 |
For URI query, you can customize the detailed message format for query included in the request message (header) and then specify.
An example of specification of query is as follows:
<xsd:complexType name="uri-query-type"> <xsd:sequence> <xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="1024" /> </xsd:sequence> </xsd:complexType> |
<xsd:complexType name="uri-query-type"> <xsd:sequence> <xsd:element name="parameter1" type="xsd:string" minOccurs="0"/> <xsd:element name="parameter2" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> |
<http-header-request> <uri-scheme-authority>http://localhost:80</uri-scheme-authority> <uri-path>/test/selectdata</uri-path> <uri-query> <parameter1>value1</parameter1> <parameter2>value2</parameter2> </uri-query> </http-header-request> |
http://localhost:80/test/selectdata?parameter1=value1¶meter2=value2 |
You can specify any extension header for HTTP request header according to http-header element (any type) of the request message (header) and adphttp.request.header.userdef.<Additional number> property of HTTP-adapter runtime-environment property file (or HTTP-adapter runtime-environment common property file).
You can specify any name space, since only locale name is used for element name.
If separate headers are specified in the request message (header) and HTTP-adapter runtime-environment property file (or HTTP-adapter runtime-environment common property file), only the specification in the request message (header) is valid. The header specified in HTTP-adapter runtime-environment property file is not added in the specification in the request message (header).
An example of specification of HTTP header is as follows:
<http-header-request> <http-header> <X-PRIORITY>HIGH</X-PRIORITY> <X-DOCUMENT-ID>12345-67890</X-DOCUMENT-ID> </http-header> </http-header-request> |
adphttp.request.header.userdef.1=X-PRIORITY:HIGH adphttp.request.header.userdef.2=X-DOCUMENT-ID:12345-67890 |
X-PRIORITY:HIGH X-DOCUMENT-ID:12345-67890 |
HTTP header described in the following table is ignored even if specification is in http-header element of the request message (header) and adphttp.request.header.userdef.<Additional number> property of HTTP-adapter runtime-environment property file (or HTTP-adapter runtime-environment common property file).
Table 2-35 Example of specification in special HTTP header
Header field name | Description |
---|---|
Content-Type | Specify this field in the following locations:
|
Cookie | Specify this field in the following location:
|
Proxy-Authorization | Set Proxy-Authorization header used to connect to the proxy server in JavaVM system properties. For details, see "2.14.6 Communication through proxy servers". |
Connection | Set headers related to connection control such as Connection: Keep-Alive in JavaVM system properties. For details, see "2.14.7 Communication using connection continuity (Keep-Alive)". |
Content-Length | HTTP adapter is set automatically. |
Accept-Encoding | HTTP adapter is set automatically. |
Authorization | Specify this field in the following location:
|
Points to be considered when HTTP header is specified are as follows:
You can select the data type to be sent in HTTP request body from the following details:
You can specify HTTP request body data type in the binding element of the request message (header) and adphttp.request.part.message.binding property of HTTP-adapter runtime-environment property file (or HTTP-adapter runtime-environment common property file).
However, if files element exists in the request message (header), it will be handled as file data even if the above element (or property) is specified. Similarly, if adphttp.request.part.file.<Additional number>.input-folder-name property of HTTP-adapter runtime-environment property file (or HTTP-adapter runtime-environment common property file) exists, it will be handled as file data even if adphttp.request.part.message.binding property is specified.
To send form data by normal mode, customize and then specify the message format for form data provided by the service platform.
An example of specification of form data is as follows:
<xsd:complexType name="http-body-form-data-type"> <xsd:sequence> <xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> |
<xsd:complexType name="http-body-form-data-type"> <xsd:sequence> <xsd:element name="parameter1" type="xsd:string" minOccurs="0"/> <xsd:element name="parameter2" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> |
<http-body-formdata> <parameter1>value1<parameter1> <parameter2>value2<parameter2> </http-body-formdata> |
Content-Type: application/x-www-form-urlencoded parameter1=value1¶meter2=value2 |
URL encoding occurs for the specified form data. Default character code is UTF-8.
If data specified in the request message (body) in pass-through mode is set as is in HTTP request body, create a message format of the request message (body) that matches HTTP request body format to be sent.
In HTTP adapter, you can send the files in the working folder or common folder to the target server.
Working folder is a temporary folder created on HCSC server for each request by HTTP reception or FTP reception. You can only see the working folder from the business process invoked by the created reception.
Common folder is any folder created by the user during system setup. You can store files shared and used by multiple business processes.
To send file data, specify information related to file data in the request message (header) and HTTP-adapter runtime-environment property file (or HTTP-adapter runtime-environment common property file). You can only use common folders to specify in the property files.
The following table describes the specification locations of file data:
Table 2-36 Specification methods of file data
Specification method | Item | Specification location |
---|---|---|
Request message (header) | Working folder request ID | request-id element |
Used folder | common attribute of input-folder-name element | |
Common folder definition name | input-folder-name element | |
Name of file to be sent | local-file-name element | |
Media type of Content-Type header field of send data | http-header-Content-Type element | |
charset attribute value of Content-Type header field of send data | charset attribute of http-header-Content-Type element | |
HTTP-adapter runtime-environment property file, HTTP-adapter runtime-environment common property file | Working folder request ID | - |
Used folder | - | |
Common folder definition name | adphttp.request.part.file.<Additional number>.input-folder-name | |
Name of file to be sent | adphttp.request.part.file.<Additional number>.local-file-name | |
Media type of Content-Type header field of send data | adphttp.request.header.content-type | |
charset attribute value of Content-Type header field of send data | adphttp.request.header.content-type.charset |
The following figure shows an example of file sending using HTTP adapter:
Figure 2-87 Example of file sending using HTTP adapter (while using common folder)
The value of the request message (body) passed to HTTP adapter is ignored while sending file data. Use message format for file data to store blank body data in the message format of the specified request message (body).
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.