uCosminexus Service Platform, Basic Development Guide

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

Appendix F. Inheriting HTTP header and Cookie information in which service adapter is used

This section describes method to inherit HTTP header and Cookie information in the business process, by using Inherit HTTP header function of the service adapter.

For overview of Inherit HTTP header function, see "2.2.5 Inherit HTTP header in case of Web service(SOAP communication)" in the "Service Platform Function Guide"

Following section describes the method of defining a business process with example of inheriting HTTP header and Cookie information in the business process shown in the following figure:

Figure F-1 FigureBusiness process used for inheriting Cookie information

[Figure]

Flow for defining a business process is as follows:

  1. Defining activities
  2. Creating schema of header variable
  3. Creating header variables
  4. Setting up allocation variables in Invoke service activity
  5. Mapping the transformation source variable and transformation destination variable
Organization of this section
(1) Defining activities
(2) Creating schema of header variable
(3) Creating header variables
(4) Setting up allocation variables in Invoke service activity
(5) Mapping the transformation source variable and transformation destination variable

(1) Defining activities

Schedule an activity in business process definition screen. For details on scheduling and connecting an activity, see "5.4 Deploying and Linking Activities".

(2) Creating schema of header variable

Create a schema of header variable for HTTP request and schema of header variable for HTTP response. The created schema use a template file provided by Service Platform, according to the following objectives:

When sending and receiving Cookie of " JSESSIONID" by using SOAP1.1 mode, change c4web.application.app_maintainsession of the client definition file to true. For details on the client definition file, see "10.3 Setting up the client definition file" in the "Application Server SOAP Application Development Guide"

(a) Schema of header variable for HTTP request

Create a schema of header variable for HTTP request. Tilted part indicates change locations.

Following table describes the contents of schema for HTTP request header settings:

Table F-1 TableContents of schema for HTTP request header settings

# Tag name Type Occurrence count Description
1 HTTPHeader_request - One time -
2 +<Cookies>
|
|
- 0 times or 1 time Acquires and stores Cookie information stored in the HTTP request header.
3 +<HTTPHeader> - 0 times or 1 time Acquires and stores the extension header stored in the HTTP requester header. Ignores the extension header existing in HTTP request header.

Legend:
-: Corresponding description does not exist.

(b) Schema of header variable for HTTP response

Create a schema of header variable for HTTP response. Tilted part indicates change locations.

Following table describes the contents of schema for HTTP response header settings

Table F-2 TableContents of schema for HTTP response header settings

# Tag name Type Occurrence count Description
1 HTTPHeader_response - 1 time -
2 +<Cookies>
|
|
|
- 0 times or 1 time Acquires and stores Cookie information stored in HTTP response header. Set-Cookie attribute in the HTTP response header is ignored.
3 +<HTTPHeader> - 0 times or 1 time Acquires and stores the extension header stored in HTTP response header. Extension header existing in the HTTP response header is deleted.

Legend:
-: Corresponding description does not exist.

(3) Creating header variables

Create header variable for HTTP request and header variable for HTTP response. Procedure for creating is as follows:

  1. Double click Variable/correlation set icon on the canvas on the business process definition screen.
    Variable/correlation set list dialog is displayed. For details on the variable/correlation set list dialog, see "1.4.1 Variable/correlation set list dialog" in the "Service Platform Reference Guide".
  2. Select Variables list from the list.
  3. Enter any name in the variable name.
  4. From Type drop down list, select XML.
  5. Click ... button to set up schema of header variable for HTTP request created in "(2) Creating schema of header variable".
  6. Insert check mark in the [Specify part] check box.
  7. Click Add row button and specify part name, specification expression and type.
  8. Click Add button.
    Added variables are displayed in the variables list.
  9. Create header variable for HTTP response, by the procedure similar to step 3.~8..
  10. Click OK button.

(4) Setting up allocation variables in Invoke service activity

Set up variables for created request message and response message, in the header allocation variables of Invoke service activity.

  1. Double click the Invoke service activity "Invoke service 1" in the business process definition screen.
    Invoke service activity dialog is displayed. For details on the Invoke service activity dialog, see "1.4.9 Invoke service activity dialog" in the "Service Platform Reference Guide".
  2. Click Settings button of Header allocation variables of Request message.
    Header allocation variable dialog for request message is displayed.
  3. Click Add button.
    Line for setting up the allocation variables is displayed.
  4. Click Allocation variables column and select the allocation variables for the request corresponding to Invoke service 1.
  5. Click Root element column and select the root element.
  6. Check the namespace of allocation variables displayed in Namespace column.
  7. Click OK button.
  8. Set up allocation variables for request, in header allocation variables of Response message, with the procedure similar to step 2.~7.
  9. Set up allocation variable for request and response also in Invoke service activity "Invoke service 2" and "Invoke service 3", with the procedure similar to step1.~8.

(5) Mapping the transformation source variable and transformation destination variable

Perform mapping of transformation source schema and transformation destination schema in the data transformation definition screen.

Perform mapping of allocation variable set in response message of Invoke service 1 and allocation variable set in the request message of Invoke service 2, for inheriting the Cookie information between Invoke service 1 and Invoke service 2.

Similarly, perform mapping of allocation variable set in the response message in Invoke service 2 and allocation variable set in the request message of Invoke service 3, for inheriting Cookie information between Invoke service 2 and Invoke service 3.

Also, perform mapping of allocation variable set in response message of Invoke service 3 and allocation variable set in response 1, for inheriting the Cookie information between Invoke service 3 and response 1.

Procedure for mapping is as follows:

  1. Right click the data transformation activity "Data transformation 1" and select Start mapping definition.
  2. Perform mapping of the node of transformation source variable and node of transformation destination variable.
    Edit the inherited data by scheduling each function.
  3. Perform mapping from Invoke service 2 to invoke service 3 and Invoke service 3 to response 1, with the procedure similar to step1.~2.
  4. Right click the appropriate locations in transformation source schema tree viewer, mapping viewer or transformation destination schema tree viewer, in the data transformation definition screen and select Validate.
    Validation is executed. If validation result has no problem, you can execute the business process.