2.2.7 Dynamic change in connection destination in Web service (SOAP communication)
(1) Flow of dynamic change process in communication destination
The following points describe the flow of dynamic change process in communication destination in SOAP communications in each communication infrastructure:
(a) When using SOAP communication infrastructure
The following figure shows the flow of dynamic change process in the communication destination when SOAP communication infrastructure is used in communication infrastructure:
Figure 2-22 Flow of dynamic change process in communication destination when SOAP communication infrastructure is used in communication infrastructure
![[Figure]](figure/zc023500.gif)
- Description
- The numbers in the figure correspond to the following numbers:
- Acquire connection destination URL from the header message in the request message.
- Create SOAP message on the basis of request message information.
- Communicate with the service in the acquired connection destination URL.
(b) When using JAX-WS engine
The following figure shows the flow of dynamic change process in the communication destination when JAX-WS engine is used in the communication infrastructure:
Figure 2-23 Flow of dynamic change process in communication destination when JAX-WS engine is used in communication infrastructure
![[Figure]](figure/zc023600.gif)
- Description
- The numbers in the figure correspond to the following numbers:
- Acquire connection destination URL from the header message in the request message.
- Create SOAP message on the basis of request message information.
- Set the connection destination URL.
- Communicate with the service of the set connection destination URL.
(2) Example of dynamic change of connection destination information
The following points describe an example of dynamic change of connection destination information by using the connection destination information file.
(a) Example of a business process
The following figure shows an example of a business process using connection destination information file:
Figure 2-24 Example of business process using connection destination information file (in SOAP adapter)
![[Figure]](figure/zc080114.gif)
- The service requester requests for execution of a service component in the business process.
- Set the connection destination URL in the header message in the request message sent from the service requester.
- The business process receives XML request messages by the receive activity.
- The business process generates header request data and request data.
- Set the connection destination URL of the header request data in the connection destination URL variable by data transformation activity.
- The business process acquires the connection destination URL from the connection destination URL variable and invokes the service component.
- The business process configures the service component execution result as an XML response message and returns it by a reply activity.
- Response is returned to the service requester.
- XML response message is sent in the response to the service requester.
(3) Example of WSDL creation generating user-defined reception
The following figure shows an example of creating WSDL that generates user-defined reception:
In this example, service component URL to be connected is sent by SOAP header.
![[Figure]](figure/zc080115.gif)
(a) Example of setting data transformation activities
The following figure shows an example of setting data transformation activities used in the business process shown in "Figure2-24 Example of business process using connection destination information file (in SOAP adapter)":
Here, "Header request data" is specified in the transformation source and "Connection destination URL" is specified in the transformation destination.
Figure 2-25 Example of setting data transformation activities (in SOAP adapter)
![[Figure]](figure/zs080300.gif)
The following figure shows the definition of transformation mapping:
Figure 2-26 Example of setting transformation mapping (in SOAP adapter)
![[Figure]](figure/zs080400.gif)
(b) Defining connection destination information file
Define URL for connecting to Web service in the connection destination information file (XML schema) used for performing setup in a service adapter.
Connection destination information file is provided in the service platform.
- Storage location of connection destination information file
<Installation directory of the service platform>/CSC/schema/connection/connection_soap_adapter.xsd
- Note
- Use the connection destination information file provided in the service platform to dynamically change connection destination information of SOAP adapter. Operation is not guaranteed if you do not use the provided connection destination information file.
- Format of connection destination information file
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT EDIT THIS FILE.
-->
<xsd:schema
elementFormDefault="qualified"
targetNamespace="http://www.hitachi.co.jp/soft/xml/cosminexus/csc/connection/change/soap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="soapAddress">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="endpointURL" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> |
- Element that can be set
- endpointURL~<Character string>
- Specify connection destination URL of the service component.
(c) Setting connection destination information
The following figure shows an example of setting connection destination information used in the business process shown in "Figure2-24 Example of business process using connection destination information file (in SOAP adapter)". Set connection destination information in the header assigned variable of the invoke service activity. You can see the information set here in SOAP adapter.
Figure 2-27 Example of setting connection destination information (setting invoke service activity)
![[Figure]](figure/zs080500.gif)
(4) Notes
- You cannot dynamically change possibility of use of basic authentication and user ID and password used in basic authentication by using the connection destination URL. Information related to basic authentication is enabled by information set from the development environment screen.
- Error message is output and abnormal termination occurs in the following cases:
- If multiple connection destination information items in the development environment are set in the header assigned variable
If multiple system-specific names spaces and element names of XML data exist, error occurs because you cannot specify the connection destination.
- If the set connection destination information is invalid
If there is an error in the connection destination URL, error occurs during service invocation.
- If endpointURL element of XML data showing connection destination information does not exist
If endpointURL element does not exist, error occurs because you cannot specify the connection destination.