Appendix F. Inheriting HTTP header and Cookie information in which service adapter is used
(1) Defining 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:
- To inherit as a batch, without editing Cookie information
- To inherit by dividing for each Cookie name, in configurable status
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.
- Definition of the HTTP header request part (for handling Cookie information in a batch)
- Template file storing destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_http_header_request1.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="soap_cookie_request1.xsd#1"/>
<xsd:element name="HTTPHeader_request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Cookies" type="hrc:Cookie_types#2" minOccurs="0" maxOccurs="1"/>
<xsd:element name="HTTPHeader" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
- #1
- Change to the include target schema file name that defines Cookie elements.
- #2
- Change according to the include target name attribute.
- Definition to be used when handling Cookie information part in a batch(part included in Cookies elements)
- Template file storage destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_cookie_request1.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Cookie_types#">
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema> |
- #
- Describe the name attribute of Cookie name to be received.
- Definition of HTTP header request part(for handling Cookie information individually)
- Template file storing destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_http_header_request2.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="soap_cookie_request2.xsd#1"/>
<xsd:element name="HTTPHeader_request">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Cookies" type="hrc:Cookie_types#2" minOccurs="0" maxOccurs="1"/>
<xsd:element name="HTTPHeader" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
- #1
- Change to the include target schema file name that defines Cookie elements.
- #2
- Change according to include target name attribute.
- Definition to be used for individually handling Cookie information part(part included in Cookies element)
- Template file storage destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_cookie_request2.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_request"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Cookie_types#1">
<xsd:sequence>
<xsd:element name="Cookie" type="hrc:Cookie_type" minOccurs="0" maxOccurs="unbounded"#2 />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Cookie_type">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string" use="optional"/>
<xsd:attribute name="path" type="xsd:string" use="optional"/>
<xsd:attribute name="host" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema> |
- #1
- Describe name attribute of Cookie name to be received.
- #2
- Set up the maximum count and minimum count of elements that can be defined, in maxOccurs attribute and minOccurs attribute.
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.
- Definition of HTTP header response part(for handling Cookie information in a batch)
- Template file storing destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_http_header_response1.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="soap_cookie_response1.xsd#1"/>
<xsd:element name="HTTPHeader_response">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Cookies" type="hrc:Cookie_types#2" minOccurs="0" maxOccurs="1"/>
<xsd:element name="HTTPHeader" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
- #1
- Change to the include target schema file name that defines Cookie elements.
- #2
- Change according to include target name attribute.
- Definition to be used for handling Cookie information part in a batch(part included in Cookies element)
- Template file storing destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_cookie_response1.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Cookie_types#">
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema> |
- #
- Describe the name attribute of Cookie name to be received.
- Definition of HTTP header response part(for individually handling Cookie information)
- Template file storing destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_http_header_response2.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:include schemaLocation="soap_cookie_response2.xsd#1"/>
<xsd:element name="HTTPHeader_response">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Cookies" type="hrc:Cookie_types#2" minOccurs="0" maxOccurs="1"/>
<xsd:element name="HTTPHeader" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##any" processContents="skip"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
- #1
- Change to the include target schema file name that defines Cookie elements.
- #2
- Change according to the include target name attribute.
- Definition to be used for individually handling the Cookie information part(part included in Cookies element)
- Template file storing destination:
- <Service Platform installation directory>\CSC\schema\soap\soap_cookie_response2.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- All Rights Reserved. Copyright (C) 2012, Hitachi, Ltd. -->
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:hrc="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/soap/http/header_response"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Cookie_types#1">
<xsd:sequence>
<xsd:element name="Cookie" type="hrc:Cookie_type" minOccurs="0" maxOccurs="unbounded"#2 />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Cookie_type">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string" use="optional"/>
<xsd:attribute name="path" type="xsd:string" use="optional"/>
<xsd:attribute name="host" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:schema> |
- #1
- Describe the name attribute of Cookie name to be received.
- #2
- Set up the maximum count and minimum count of elements that you can define, in maxOccurs attribute and minOccurs attribute.
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:
- 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".
- Select Variables list from the list.
- Enter any name in the variable name.
- From Type drop down list, select XML.
- Click ... button to set up schema of header variable for HTTP request created in "(2) Creating schema of header variable".
- Insert check mark in the [Specify part] check box.
- Click Add row button and specify part name, specification expression and type.
- Click Add button.
Added variables are displayed in the variables list.
- Create header variable for HTTP response, by the procedure similar to step 3.~8..
- 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.
- 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".
- Click Settings button of Header allocation variables of Request message.
Header allocation variable dialog for request message is displayed.
- Click Add button.
Line for setting up the allocation variables is displayed.
- Click Allocation variables column and select the allocation variables for the request corresponding to Invoke service 1.
- Click Root element column and select the root element.
- Check the namespace of allocation variables displayed in Namespace column.
- Click OK button.
- Set up allocation variables for request, in header allocation variables of Response message, with the procedure similar to step 2.~7.
- 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:
- Right click the data transformation activity "Data transformation 1" and select Start mapping definition.
- Perform mapping of the node of transformation source variable and node of transformation destination variable.
Edit the inherited data by scheduling each function.
- Perform mapping from Invoke service 2 to invoke service 3 and Invoke service 3 to response 1, with the procedure similar to step1.~2.
- 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.