uCosminexus Service Platform, Reception and Adapter Definition Guide
This subsection describes how to define HTTP adapters. To confirm the operations of HTTP adapter on the basis of an actual setup example, see Appendix G Example for setting up business processes using HTTP reception and HTTP adapter.
To operate an HTTP adapter in the execution environment, add the library (cjjaxrs.jar) of JAX-RS to the class path of a J2EE server. Edit the option definition file for a J2EE server (usrconf.cfg) and describe the following contents:
add.class.path=Installation directory of the service platform\jaxrs\lib\cjjaxrs.jar |
For details on the option definition file for the J2EE server (usrconf.cfg), see 2.3 usrconf.cfg (option definition file for a J2EE server) in the manual Application Server Definition Reference Guide.
The types, formats, and methods to create message formats to be used in the HTTP adapter are described here.
The following table describes the message format types to be used in the HTTP adapter:
Table 3-75 Message format types
| Major type | Intermediate type | Minor type | Description | Editable |
|---|---|---|---|---|
| Request message format | For header variable | Request message format(for header variables) | This is the message format of header assigned variables that specify the information on the HTTP request header. Use the following schema files provided by the service platform:
|
N |
| Detailed message format for a query | This is the message format to set the query information. The service platform provides the schema file adphttp_header_query_detail.xsd. Use the file by editing the parameter settings. |
A | ||
| For body variable | Message format for the file data | This is the message format to be set if the HTTP request body is not handled when you send only file data. The service platform provides the schema file adphttp_body_empty.fdx. |
N | |
| Message format for the form data | This is the message format used to set the form data in the HTTP request body. The service platform provides the schema file adphttp_body_form-data.xsd. You use the file by editing the parameter settings. |
A | ||
| Message format for the pass-through mode | Create this message format to send any HTTP request body with the pass-through mode. In this case, schema files are not provided in the service platform. | Y | ||
| Response message format | For header variable | Response message format(for header variables) | This is the message format to assign the received HTTP response header and the status line. Use the following schema files provided by the service platform:
|
N |
| For body variable | Message format for the file data | This is the message format to be set if the HTTP response body is not handled when you send only file data. The service platform provides the schema file adphttp_body_empty.fdx. |
N | |
| Message format for the pass-through mode | Create this message format to send any HTTP response body with the pass-through mode. No schema files are provided in the service platform. |
Y | ||
| Fault message format | This is the message format to assign any received status code to the fault information The service platform provides the schema file adphttp_fault.xsd. |
N | ||
The formats of a request message, a response message, and a fault message used in the HTTP adapter are described here.
Table 3-76 Request message format (for header variables)
| Tag name | Type | Occurrence count | Description | ||||
|---|---|---|---|---|---|---|---|
| <http-header-request> | - | 1 time | - | ||||
| <request-id> | string | 0 or 1 time | Set the request ID generated in the HTTP reception or the FTP reception.Required to send the file data in the working folder.and to receive a file in the working folder. | ||||
| <method>#1 | string | 0 or 1 time | Specify the HTTP method of the request line. You can specify any of the following values:
|
||||
| <uri-scheme-authority>#1 | string | 0 or 1 time | Specify the scheme and the authority (upto the port number of URI) of URI of the request line. URL encoding of the value is not performed. It becomes the first character string when composing the URI. | ||||
| <uri-path>#1 | string | 0 or 1 time | Specify the path of the URI of the request line. As a general rule, you must specify "/" at the beginning of the specified character string, since this string is connected immediately after the uri-scheme-authority element. You need not specify "/" in the case of root path ("/"). |
||||
| <uri-query> | string | #2 | Specify the request line query. | ||||
| <http-header-Authorization>#1 | string | 0 or 1 time | Specify the authentication information corresponding to the Authorization header of the HTTP request header. Specify the authentication type in the type attribute:
|
||||
| <http-header-Content-Type>#1 | string | 0 or 1 time | Specify the media type corresponding to the Content-Type header of the HTTP request header. Specify the character code corresponding to the charset attribute of the Content-Type header in the charset attribute. |
||||
| <http-header-Cookies> | - (any) |
0 or 1 time | Specify the Cookie information of the HTTP request. Schema files to be used differ depending on whether you set Cookie elements in a batch or individually:
|
||||
| <Cookie> | string | 0 or more | Specify the Cookie information of the HTTP request in the format of the Set-Cookie header passed from the HTTP response for each Cookie information. Specify the Cookie name of the Set-Cookie header of the HTTP response in the name attribute. Specify the host name (domain) of the server that sends the Cookie of the Set-Cookie of the HTTP response in the host attribute. Specify the path of the server that sends the Cookie of the Set-Cookie header of the HTTP response in the path attribute. For the value of each attribute and element of Cookie elements, use the value of Cookie elements of the response message (header) in which the Cookie information to be inherited is stored. If you set any other value, operations to be performed are not guaranteed. |
||||
| <http-header> | - | 0 or 1 time | Specify the HTTP header information. | ||||
| Any element#1 | string | 0 to 1,024 times | Specify the HTTP header information such that the header field name is to be specified in the element name and the header field value is to be specified in the element value. This is ignored if the hierarchical structure and attribute value are specified, and also when some particular header information is specified. For details, see 2.14.3 Relationship between HTTP requests and request messages in the manual Service Platform Overview. |
||||
| <http-part> | - | 0 or 1 time | Specify the meta information of parts. | ||||
| <message> | - | 0 or 1 time | Specify the information related to request messages (body). | ||||
| <binding>#1 | string | 1 time | Specify any of the following methods as the method to process a request message (body):
|
||||
| <files> | - | 0 or 1 time | Specify the file information sent with the HTTP request. If you specify this element, even if the request message (body) is already set, the content specified in this element takes precedence. |
||||
| <file> | - | 0 or more | Specify the information related to the file to be sent. If you specify this element for more than 2 times, the element acquired first is considered as valid. |
||||
| <input-folder-name>#1 | string | 1 time | Specify any of the following folders as the folder to store the file to be sent:
|
||||
| <local-file-name>#1 | string | 1 time | Specify name of the file to be sent:
In addition, an error occurs in the following cases:
|
||||
| <output-folder-name>#1 | string | 0 or 1 time | Specify any of the following folders as the folder to output the downloaded file at the time of the HTTP response:
|
||||
Table 3-77 Detailed message format for a query
| Tag name | Type | Occurrence count | Description | |
|---|---|---|---|---|
| <uri-query> | - | 0 or 1 time | - | |
| Any element # | string | 0 to 1,024 | Set the detailed information of the request line query. | |
Table 3-78 Message format for file data
| Simple content element | Type | Occurrence count | Description | |
|---|---|---|---|---|
| <http-body-common-empty> | - | 1 time | - | |
| <data> | String | 0 or more | Specifies an element used to pass an empty data. You can omit this element. | |
Table 3-79 Message format for the form data
| Simple content element | Type | Occurrence count | Description | |
|---|---|---|---|---|
| <http-body-form-data> | - | 1 time | - | |
| Any element | String | 0 or more | Specify any element according to the form data sent with the HTTP request body. | |
Table 3-80 Response message format (for header variable)
| Tag name | Type | Occurrence count | Description | ||||
|---|---|---|---|---|---|---|---|
| <http-header-response> | - | 1 time | - | ||||
| <request-id> | string | 0 or 1 time | The request ID specified in the request message is set. If you do not specify a request ID in the request message, this element is not generated. |
||||
| <status-code> | string | 1 time | The status code of the status line of the HTTP response is set. | ||||
| < reason-phrase> | string | 1 time | The reason phrase part of the status line is set. | ||||
| <http-header-Content-Type> | string | 0 or 1 time | The media type of the Content-Type header is set. | ||||
| <http-header-Cookies> | - (any) |
1 time | The Set-Cookie header of the HTTP response is set. Schema files to be used differ depending on whether you set Cookie elements in a batch or individually.
|
||||
| <Cookie> | string | 0 or more | The Set-Cookie header of the HTTP response is stored for each Cookie information. The Cookie name of the Set-Cookie header of the HTTP response is set in the name attribute. The host (domain) name of the server that sends the Cookie of the Set-Cookie header of the HTTP response is set in the host attribute. The path of the server that sends the Cookie of the Set-Cookie header of the HTTP response is set in the path attribute. |
||||
| <http-header> | - | 1 time | The HTTP response header is stored. | ||||
| Any element | string | 0 or more | The HTTP header information is set such that the header field name is specified in the element name and the header field value is specified in the element value. | ||||
| <http-body> | - | 1 time | The HTTP response body information is set. | ||||
| <output-folder-name> | string | 0 or 1 time | The output destination folder of the files downloaded with the HTTP response is set. The value of the output destination folder is same as the value specified in the output-folder-name element of the request message format (for header variables)
|
||||
| <http-part> | - | 1 time | The meta information of parts is set. | ||||
| <files> | - | 0 or 1 time | The file information received with the HTTP response is set. | ||||
| <file> | - | 1 time | The information of the file to be received is stored. | ||||
| <local-file-name> | string | 1 time | Name of the file output to a common or a working folder is set.
|
||||
| <file-name> | string | 0 or 1 time | The value specified in the filename attribute of the Content-Disposition header is set. If the filename attribute is not present, this element is not generated. |
||||
| <context> | - | 1 time | The execution information of the HTTP adapter is stored. | ||||
| <adapter-name> | string | 1 time | The name of the adapter that has sent an HTTP request that is the basis of this HTTP response is set. | ||||
| <operation-name> | string | 1 time | Name of the operation of sending an HTTP request that is the basis of this HTTP response is set. | ||||
| <request-method> | string | 1 time | The method type of the HTTP request that is the basis of this HTTP response is set. | ||||
| <request-uri> | string | 1 time | URI (Authorization, Path excluding Scheme and UserInfo) of the HTTP request that is the basis of this HTTP response is set. | ||||
Table 3-81 Fault message format
| Tag name | Type | Occurrence count | Description | ||
|---|---|---|---|---|---|
| <http-fault> | - | 1 time | - | ||
| <status-code> | string | 1 time | The status code of the status line of an HTTP response is set. | ||
| < reason-phrase> | string | 1 time | The reason phrase part of the status line is set. | ||
| <http-header> | - | 1 time | The HTTP response header is stored. | ||
| Any element | string | 0 or more | The HTTP header information is set such that the header field name is specified in the element name and the header field value is specified in the element value. | ||
| <context> | - | 1 time | The execution information of the HTTP adapter is stored. | ||
| <adapter-name> | string | 1 time | The name of the adapter that has sent the HTTP request which is the basis of this HTTP response is set. | ||
| <operation-name> | string | 1 time | The name of the operation of sending an HTTP request which is the basis of this HTTP response is set. | ||
| <request-method> | string | 1 time | The method type of the HTTP request that is the basis of this HTTP response is set. | ||
| <request-uri> | string | 1 time | URI (Authorization, Path excluding Scheme and UserInfo) of the HTTP request that is the basis of this HTTP response is set. | ||
The method to create the message format used in the HTTP adapter is described here.
The XML schema of the message format provided by the service platform is stored in "Installation directory of the service platform\CSC\custom-adapter\HTTP\schema".To edit, first copy folder-wise contents at any location, and then edit.
The method to create the following formats is as follows:
Creating Detailed message format for a query
The procedure for defining HTTP adapters is as follows:
The following are the types of the definition files to be created and edited:
Note that the creation and editing of these definition files is optional. If omitted, the default value for each definition file is used.
The procedure for creating and editing each definition file is as follows:
Edit the HTTP-adapter definition file by using the template file provided by the service platform.
The procedure for editing the HTTP-adapter definition file is as follows:
For details on the definition contents that you can edit in the HTTP-adapter runtime-environment property file, see HTTP-adapter runtime-environment property file in the manual Service Platform Reference Guide.
The HTTP-adapter runtime-environment property file is reflected in the execution environment when you start an HTTP adapter. Therefore, to change the contents of the HTTP-adapter runtime-environment property file, you must stop the HTTP adapter once.
The definition contents that you can edit in the HTTP-adapter runtime-environment common property file are same as the contents of the HTTP-adapter runtime-environment property file. For details, see HTTP-adapter runtime-environment common property file in the manual Service Platform Reference Guide.
HTTP-adapter runtime-environment common property file is reflected in the execution environment, when you start an HTTP adapter. Therefore, to change the contents of the HTTP-adapter runtime-environment common property file, you must stop the HTTP adapter once.
If settings such as the proxy server or connection inheritance are required, set it using the system property file (usrconf.cfg).For details on the properties to be set in the HTTP adapter, see 2.14.6 Communication through proxy servers in the manual Service Platform Overview and 2.14.7 Communication using connection continuity (Keep-Alive) in the manual Service Platform Overview.
If you use an HTTP adapter, you must set the invoke service activities and fault processing, if necessary.
The following is the method to set the invoke service activities and fault processing:
Defines the invoke service activities to invoke the HTTP adapter. For details on how to define the invoke service activities, see 5.6.4 Invoke service activity in the manual Service Platform Basic Development Guide.
The settings of the [Invoke service activities] dialog box are as follows:
| Item | Setting value | |
|---|---|---|
| Activity name | Set any name. | |
| Service name | Specify the service name set at the time of adding a new HTTP adapter. | |
| Operation name | Specify the operation name specified in (3) Operations to be performed on the service adapter settings screen. | |
| Request message | Body assigned variable | Specify a variable in the following manner according to the format of the data to be sent:
|
| Assign header variable#2 | Specify a variable in the following manner according to the method to set the Cookie:
|
|
| Response message | Assign body variable | Specify a variable in the following manner according to the format of the data received:
|
| Assign header variable#2 | Specify a variable in the following manner according to the method to set the Cookie:
|
|
| Assign correlation set suite | Do not set. | |
If you process a system exception that is converted to a status code or a fault that you cannot process as a normal node, as an error in the business process, define the fault processing in the invoke service activity and in the upper-level scope. For details on the method to define the fault processing, see 5.4.3 Defining Fault Handling in the manual Service Platform Basic Development Guide.
The settings of the [Assign the fault processing] dialog box are as follows:
| Item | Setting value |
|---|---|
| Assigned variable |
|
| Transition destination | Specify any activity that is transitioned when a fault has occurred. |
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.