uCosminexus Service Platform, Basic Development Guide
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
Flow for defining a business process is as follows:
Schedule an activity in business process definition screen. For details on scheduling and connecting an activity, see "5.4 Deploying and Linking Activities".
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"
Create a schema of header variable for HTTP request. Tilted part indicates change locations.
<?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> |
<?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> |
<?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> |
<?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> |
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. |
Create a schema of header variable for HTTP response. Tilted part indicates change locations.
<?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> |
<?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> |
<?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> |
<?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> |
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. |
Create header variable for HTTP request and header variable for HTTP response. Procedure for creating is as follows:
Set up variables for created request message and response message, in the header allocation variables of Invoke service activity.
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:
All Rights Reserved. Copyright (C) 2015, Hitachi, Ltd.