Download StationWare 4

Transcript
Chapter 23
Web services interface
This chapter discusses the web services methods that can be used to access components of the StationWare system and complete complex automation task using external software and scripting languages. The following topics will be addressed:
• Web services background
• Methods available in the StationWare web service
• An example web service query using Python
23.1
Web services background
Web services are a common method of enabling third party tools and interfaces to access existing web
based database and software systems. Essentially, it is a framework that defines a list of functions, their
inputs, calling methodology, and the values that they return.
Due to the widespread popularity of web services, many programming languages such as Python have
built-in libraries and methods that make it easy to call the available functions.
StationWare supports the Web Services Description Language (WSDL) which is an XML based language for describing the available functions provided by the web service. Before accessing the web
services, they must be enabled by the system administrator. The procedure for doing this is described
in the StationWare installation manual.
After it is installed the web services can be accessed at:
http://<ServernameOrIpaddress>/<ServiceAlias>/PSMSService.asmx
This link will show a list of all the available web services methods. Clicking on the hyper-linked named of
one of the methods will provide additional information about it. For example, the method “LocationGetSublocations” can be used to retrieve the sub-locations of any object within the StationWare tree. The
XML request definition of the method (SOAP 1.2) is as follows:
POST /swws_dpmelb42b_service/PSMSService.asmx HTTP/1.1
Host: 10.0.30.62
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
DIgSILENT StationWare 4, User Manual
171