Web Services and XML

The ODBC driver now shipping with VTScada provides a REST interface, and does not implement SOAP. Customers who have existing SOAP applications can continue to use those. The new driver, supporting REST, is installed as the "VTScada ODBC driver" The older driver, supporting SOAP, was installed as "VTS ODBC Driver". Both may be installed on the same server.

The Web Services Module provides a means for VTScada to receive Simple Object Access Protocol (SOAP) requests over a network and translate those requests into VTScada procedural requests. The results of these requests can be compiled back into the SOAP message format and sent back to the remote computer.

The ability to provide Web Services is a separate licensing option of VTScada. If you did not purchase a license for Remote Data Access, it will not be available on your system.

This technology enables multi-server applications to make use of selected VTScada services that you choose to provide from your application. Possible applications range from remote reporting to complex delivery scheduling systems, relying on calculations done in VTScada to predict when material deliveries will be required.

The WebService module links together a WSDL document, a VTScada Realm, and a set of project-defined VTScada modules. This linkage enables VTScada to accept SOAP messages directed at specific VTScada Realms via the network and translate those messages into procedural requests for VTScada applications. The results of these requests can then be compiled back into SOAP message format and returned to the network entities that made the requests.

Realms can be accessed only by authorized users. Security must be enabled and there must be at least one account with the Thin Client Access privilege.

The WSDL document

A generic WSDL file is included with VTScada, C:\VTScada\VTS\VTSSOAPServices.wsdl. Before creating your own WSDL file, examine this one to determine whether it can be modified to meet your needs.

The WSDL file describes the structure of the web service. At a minimum the WSDL file will define, in XML format:

  • The operations that are available.
  • The data types of variables passed and returned.
  • The location of the Realm to which the application is linked.

The WSDL file must also include the name of the module to be called. Incoming SOAP messages will use this same name to indicate the module to call. Outgoing messages will use the name of the module with the string "Response" appended, thereby indicating their source.

The Realm

Each VTScada Realm can expose a single WSDL and connect it to a specific module within a single application. All VTScada modules to be called via that Realm must be direct submodules of the connected module, so that the WebService functions can locate them.

Subsequent WSDL attachments to the same Realm will supersede existing attachments, not aggregate with them.

After a Realm is attached to a WSDL it can start accepting SOAP messages immediately and will continue to accept them until the attachment is removed. The individual calls can accept up to 30 parameters each.

The parameters must be provided as defined by the WSDL and passed via the SOAP message. In the case that a complex type is sent as a parameter in the message, that parameter will be passed to the module as a XMLNode Tree.

The module

The project-defined VTScada module commonly takes the form of a .SRC file in the application's main directory. It is reserved by the system as the root of the web service. Submodules of this root are used to expose parameters and VTScada operations to the WebService.

Only one module can be associated with a realm, but since this module may contain submodules that are available to the web service, an effectively unlimited number of SOAP calls can be handled via the single root module

Do not confuse the module with the application pages. None, any or all tags from any or all application pages may be exposed to the web service through the module system.

A key feature of the module will be a call to the WebService function, SetWSDL. This function connects a Realm to the application to provide the web service interface. An example of a call to this function can be found in the Web Services Example: Creating the VTScada Module.

VTScada is compliant with SOAP 1.1 not with SOAP 1.2. Messages must be encoded for SOAP 1.1.