Dispatcher. The same process is made for the
response, coming from the application. To map the
response, coming from application, the Mapper uses
another map file (Response Map file) that allows
translating the message wrote according to the
format of the specific application in the format
defined by GI specification.
For each request forwarded by the Mapper, the
Dispatcher makes the following steps. It finds the
correct HTTP address of Web Service relevant to the
requested application and it establishes the HTTP
connection with web service. Then, it sends request
and receives response. Finally, it handles the
cookies, as explained in the following.
In principle, each instance of SCADA, GIS and
DSS application may feature more than one Web
Services, each of these exporting different Web
Methods relevant to the same application. It's clear
that client cannot know the address of each Web
Service, but it can know the application instance.
This information is specified by the client in a
particular field, the ApplicationID, contained in a
field of the XML/SOAP request sent to the GI.
Moreover the client obviously can specify the
method (expressed in terms of the Generalised
Interface Specification) to be invoked. The service
name is contained in the XML/SOAP request sent to
the GI, too. Identification of the right Web Service
address is performed by the Dispatcher on the basis
of the ApplicationID and the GI service name
requested by the client, using a database local to the
Dispatcher. This database contains for each
ApplicationID and for each GI Web Method, the
corresponding Web Service Address. When the
Dispatcher finds the right Web Service Address, it
opens an HTTP connection to the correct web
service. Then it performs the remote procedure call
to the suitable web method and waits for the
response. When the response arrives, the Dispatcher
closes the connection and delivers the response to
the Mapper.
A particular problem concerning the
communication between Dispatcher and the Web
Services of each application instance is that the
HTTP is a stateless protocol. Each request to a Web
Service is independent, and the application retains
no memory of a client’s past requests. To overcome
this limitation, management of the sessions state has
been realised using HTTP cookies.
The idea behind HTTP cookies is that when the
Dispatcher sends a request, the Web Service sends
back a response with an HTTP Set-Cookie header
that has a name/value pair in it. For all subsequent
requests to the same Web Service, the Dispatcher
sends the name/value pair in an HTTP Cookie
header. The Web Service then can use the value to
associate the subsequent requests with the initial
request. The Web Service automatically processes
this cookie and uses it to restore the values saved in
the memory for this particular client. For each
service requested by a client, the application will
preserve the information stored for the client's
session. This session information is stored in
memory on the Web Service of the application. The
client is provided with a unique cookie that the
application uses to match client requests with the
information specific to that client's session. A
session state ends when the client does not make any
HTTP requests to the application for a specified
time-out period. When the Dispatcher sends the first
request for a client, it receives the cookie from Web
Service and stores it in a local database. For all the
subsequent requests coming from the same client,
the Dispatcher gets the cookie related to the client.
Since the GI connects to several applications, it is
necessary to keep the connection state for each client
and for each application requested by the client.
4.3 Management of Multiple
Connections
GI must be able to handle concurrent multiple
connections concerning different requests by the
same client or by different clients. For each request,
it's required that an instance of the GI modules
(Parser, Mapper, Dispatcher) is created. The instance
must be deleted when the request has been satisfied.
5 GI IMPLEMENTATION
The architecture of the GI described in the previous
section has been implemented in such a way to be
not linked to a specific platform, but it has been
realised using freeware libraries.
The implementation was realised on Windows
2000 Operating System. This is only an
implementation choice, not existing constraints on
the use of this OS, as it will be pointed out in the
next.
An analysis of the state of the art about free
software/libraries useful to manipulate XML files
for the parser, mapper and dispatcher has been done,
during the first stage of the project. It highlighted the
advantages in using DOM libraries to realise parsing
of XML documents and Dispatcher functionalities,
and XSLT engine to realise the Mapper.
DOM presents an easy processed standardised
interpretation of an XML document to applications
and scripts. Different free implementations of the
DOM exist in different languages. We have used the
Microsoft XML Core Services (MSXML), realised
as DLL implementing the parser DOM in a COM
component (MSXML, 2003).
A MIDDLEWARE FOR THE MANAGEMENT OF LARGE UTILITIES PLANTS
103