The Delft-FEWS PI SOAP Web Services has been removed since Delft-FEWS 2022.01. See: Delft-FEWS End of Life Modules and Displays#FEWSEndofLifeModulesandDisplays-FEWSWebServicesAPIsthatwillberemoved


DAC installation guide (final).doc (DAC installation is obsolete since FEWS 2017.02)

Introduction

The Tomcat Fews PI service is hosted in a Tomcat service container. This service allows SOAP clients to interact with a FewsPiService that is connected to a FEWS system through the FEWS DataAccessComponent. With this API the SOAP client can retrieve data from the FEWS system. Before a client application can access the FEWS system there is some configuration work that needs to be done.

For some examples on how to connect to the service, see: FEWS PI-XML SOAP Examples. For some sample SOAP request please see FEWS PI SOAP Web Service Request examples.

PI SOAP Web Service API

Description of the methods provided by the PI SOAP Service API.

Getter methods

getTimeZoneId

String getTimeZoneId(String piVersion);

Get ID of Configured timezone for the webservice.

getFilters

String getFilters(String filterId, String piVersion);

Retrieve Pi Filters configuration from the Fews instance hosting the current FewsPiService.

The PiVersion defines the format of the return file content. If omitted the
latest version of the Pi file format will be used. (Expected 1.9 or higher)

getLocations

String getLocations(String clientId, String filterId, String piVersion);

Retrieve Pi Locations file containing all locations that are available for the passed 'filterId' argument.
If argument 'null' is passed then all locations configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getLocationsAsStream

DataHandler getLocationsAsStream(String filterId, String piVersion);

Retrieve Pi Locations file containing all locations that are available for the passed 'filterId' argument.
If argument 'null' is passed then all locations configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getParameters

String getParameters(String clientId, String filterId, String piVersion);

Retrieve Pi Parameters file containing all parameters that are available for the passed 'filterId' argument.
If argument 'null' is passed then all parameters configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getParametersAsStream

DataHandler getParametersAsStream(String filterId, String piVersion);

Retrieve Pi Parameters file containing all parameters that are available for the passed 'filterId' argument.
If argument 'null' is passed then all parameters configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesHeadersForFilter

String getTimeSeriesHeadersForFilter(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean useDisplayUnits, String piVersion);

Read the timeseries header information from the webservice. Returns a pi timeseries xml file containing the timeseries headers information belonging to the filter defined by the 'filterId'.
Retrieve the timeseries data using the method getTimeSeriesForFilter

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesHeadersForFilter2

String getTimeSeriesHeadersForFilter2(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean useDisplayUnits, String ensembleId, String piVersion);

Read the timeseries header information from the webservice. Returns a pi timeseries xml file containing the timeseries headers information belonging to the filter defined by the 'filterId'.
Retrieve the timeseries data using the method getTimeSeriesForFilter

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).


getTimeSeriesForFilter

String getTimeSeriesForFilter(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean convertDatum, boolean useDisplayUnits, String piVersion);

Returns a pi timeseries xml file containing the timeseries data belonging to the filter defined by the 'filterId'.
The 'convertDatum' argument is to allow timeseries that support a global datum to have their values converted from a value relative to the location height to an absolute value.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesForFilter2

String getTimeSeriesForFilter2(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean convertDatum, boolean useDisplayUnits, String ensembleId, String piVersion);

Returns a pi timeseries xml file containing the timeseries data belonging to the filter defined by the 'filterId'.
The 'convertDatum' argument is to allow timeseries that support a global datum to have their values converted from a value relative to the location height to an absolute value.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeries

String getTimeSeries(QueryParams queryParameters);

QueryParameters is defined by following schema definition:

<xs:complexType name="queryParameters">
    <xs:sequence>
    	<xs:element name="convertDatum" type="xs:boolean"></xs:element>
		<xs:element name="endCreationTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="endForecastTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="endTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="ensembleId" type="xs:string"></xs:element>
		<xs:element name="externalForecastTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="filterId" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="forecastSearchCount" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="importFromExternalDataSource" type="xs:boolean"></xs:element>
        <xs:element name="locationIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
		<xs:element name="omitMissing" type="xs:boolean"></xs:element>
		<xs:element name="onlyHeaders" type="xs:boolean"></xs:element>
		<xs:element name="parameterIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
		<xs:element name="piVersion" type="xs:string" minOccurs="0"></xs:element>
		<xs:element name="showStatistics" type="xs:boolean"></xs:element>
        <xs:element name="showThresholds" type="xs:boolean"></xs:element>
		<xs:element name="startCreationTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="startForecastTime" type="xs:dateTime" minOccurs="0"></xs:element>        
        <xs:element name="startTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="useDisplayUnits" type="xs:boolean"></xs:element>
    </xs:sequence>
</xs:complexType>

Returns a pi timeseries xml file containing the timeseries data belonging to the query parameters defined in the query parameters object.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesAsStream

DataHandler getTimeSeriesAsStream(QueryParams queryParameters);

Same as getTimeSeries method except this method returns a DataHandler using the MTOM protocol.

getWorkflows

String getWorkflows(String piVersion);

Retrieve Pi Workflow file containing all workflows that can be run using the method runTask.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getSamplesAsStream

DataHandler getSamplesAsStream(SampleQueryParams sampleQueryParams);

Returns a pi samples xml file containing the sample data matching the query parameters. Since FEWS2016.01.

SampleQueryParameters is defined by following schema definition:

<xs:complexType name="sampleQueryParameters">
<xs:sequence>
<xs:element name="endCreationTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="endTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="filterId" type="xs:string" minOccurs="0"/>
<xs:element name="locationIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="omitMissing" type="xs:boolean"/>
<xs:element name="onlyHeaders" type="xs:boolean"/>
<xs:element name="parameterIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="qualifierIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="sampleIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="startCreationTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="startTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="version" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

Returns a pi samples xml file as DataHandler using the MTOM protocol containing the sample data belonging to the query parameters defined in the query parameters object.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.21 or higher).

Since all parameters are optional, some defaults are chosen for the search period in case no search period or creation period was specified. The following rules apply:

getModifiers

String getModifiers(Date startTime, Date endTime, String modifierTypeId);

If no startTime and endTime are given, the search period is any time.

getTimeSeriesModifiers

String getTimeSeriesModifiers(Date startTime, Date endTime, String userId, boolean active, String[] locationIds, String[] moduleInstanceIds, String[] userDefinedDescriptions, String modifierTypeId);


Get a list of all timeSeries modifiers

Setter methods

putTimeSeriesForFilters

void putTimeSeriesForFilters(String clientId, String filterId, String piTimeSeriesXmlContent, byte[] piTimeSeriesBinaryContent, boolean convertDatum);

Write timeseries data to the FEWS system using the timeseries sets defined by the filters.

For performance reasons it is possible to split the timeseries header information from the timeseries data. The header information is stored in the piTimeSeriesXmlContent and the timeseries data is stored in the piTimeSeriesBinaryContent. If both header information and data is stored in the XML content the the 'piTimeSeriesBinaryContent' argument can be null.

The 'convertDatum' argument is to allow timeseries that support a datum to have their values converted to a value
relative to the location height. If values are already relative to location then enter FALSE or omit.

The endpoint accepts a time format with or without milliseconds, and automatically recognises the correct format.

Example:

<event date="2018-02-12" time="09:15:00.000" value="0.186" flag="2"/>
<event date="2018-02-12" time="09:16:00.250" value="0.186" flag="2"/>


<event date="2018-02-12" time="09:15:00" value="0.186" flag="2"/>
<event date="2018-02-12" time="09:16:00" value="0.186" flag="2"/>

putModifiers

void putModifiers(String piModifiersXmlContent, boolean commitModifiers, boolean deleteAllModifiers);

The method can be used to upload new modifiers to a FEWS system by using a xml file. The option commitModifiers indicates if the modifiers are committed are not after the upload.

Run methods

runTask

String runTask(String clientId, String workflowId, Date startTime, Date timeZero, Date endTime, String coldStateId, String scenarioId, String piParametersXml, String userId, String description);

Runs a workflow task for a given workflowId. Returns a handle to the task in the form of a taskid. This taskId can be used to track the status of the workflow using method call getTaskRunStatus. Additionally there are a few arguments that can be passed to control the run.

runTaskWithRunParameters

String runTaskWithRunParameters(RunParameters runParameters);

RunParameters is defined by following schema definition:

<xs:complexType name="runParameters">
    <xs:sequence>
        <xs:element name="coldStateId" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="description" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="endTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="piModuleParametersXml" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="startTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="timeZero" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="useColdState" type="xs:boolean"></xs:element>
        <xs:element name="workflowId" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="whatIfId" type="xs:string" minOccurs="0"></xs:element>
     </xs:sequence>
</xs:complexType>

Runs a workflow task for a given workflowId. Returns a handle to the task in the form of a taskid. This taskId can be used to track the status of the workflow using method call getTaskRunStatus. Additionally there are a few arguments that can be passed to control the run.

getTaskRunStatus

String getTaskRunStatus(String taskId, long maxWaitMillis)


Runs a workflow task for a given workflowId. Returns a handle to the task in the form of a taskid. This taskId can be used to track the status of the workflow using method call getTaskRunStatus. Additionally there are a few arguments that can be passed to control the run.

Installing a Tomcat Fews PI Service

N.B.: The DAC installation has become obsolete since FEWS 2017.02.

The file DAC installation guide (final).doc describes how to install a Tomcat instance containing a DataAccessComponent instance. Once these steps are completed the FewsPiService.WAR can be deployed using a context xml file such as FewsPiService.xml.

For the online installation manual check here.

Configuration

N.B.: The DAC configuration has become obsolete since FEWS 2017.02.

The are two levels of configuration. The first is the DataAccessComponent which is a FEWS client hosted as a GlobalResource in Tomcat. The DataAccessComponent uses the regular FEWS configuration which falls outside the scope of this documentation. The second level of configuration is what is used by the FewsPiService webservice which has been deployed in Tomcat. To deploy this webservice a context XML file is required which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- Location of specific AI war file. (Can be a symlink) -->
<Context docBase="${catalina.home}/fews/FewsPiService.war" antiJARLocking="true" crossContext="true" >
    <!—- 'clientConfigFileId' points to a FEWS configuration file in de FEWS configuration directory 'PiClientConfigFiles'. -->
     <Parameter name="clientConfigFileId" value="FewsPiService.properties" override="false"/>
    <!—- resourceId must match the 'name' of 'ResourceLink' below -->
     <Parameter name="resourceId" value="DAC" override="false"/>
     <Parameter name="serviceName" value="FewsPiServiceImpl" override="false"/>
     <Parameter name="namespaceUri" value="http://fewpiservice.wldelft.nl" override="false"/>
     <Parameter name="portName" value="FewsPiServiceImplPort" override="false"/>
    <!—-  'fewspi_config_naam' must match the file name of this configuration file without the XML extension. -->
     <Parameter name="wsdl" value="http://localhost:8080/FewsPiService/fewspiservice?wsdl" override="false"/>
    <!—-  Global 'fews_dac' must be the same as the DAC resource name in the file 'server.xml'-->
     <ResourceLink name="DAC"
                  global="fews_dac"
                  type="nl.wldelft.fews.system.data.dac.DataAccessComponent"/>
     <Loader loaderClass="nl.wldelft.fews.system.data.dac.DacClassLoader" delegate="true"/>
</Context>

In the above configuration example you see a number of 'Parameter' values which will be explained below:

The next parameters have been added for the FewsPiService test page. This is the page that appears when browsing to the root URI of the FewsPiService. Technically these parameters would not be required, but because it is a 'test' page, the configuration has not been optimized yet.

FEWS Client Config File (clientConfigFileId)

This is a simple text configuration file that is located in the FEWS configuration in the directory:

%REGION_HOME%/Config/PiClientConfigFiles/FewsPiService.properties

In the above example the clientConfigFileId would be FewsPiService.properties.

N.B.: Since FEWS 20170.2 the clientConfigFileId can no longer be configured and should always be called FewsPiService.properties.

For more information about the possible properties, see FEWS Web Services Configuration FewsPiService.properties (deprecated since 2022.02).

Example SOAP calls

See soap-example-calls.zip for examples SOAP client calls.

DAC installation guide (final).doc (DAC installation is obsolete since FEWS 2017.02)


The Delft-FEWS PI SOAP Web Services has been deprecated and will be removed. See: Delft-FEWS End of Life Modules and Displays#FEWSEndofLifeModulesandDisplays-FEWSWebServicesAPIsthatwillberemoved


Introduction

The Tomcat Fews PI service is hosted in a Tomcat service container. This service allows SOAP clients to interact with a FewsPiService that is connected to a FEWS system through the FEWS DataAccessComponent. With this API the SOAP client can retrieve data from the FEWS system. Before a client application can access the FEWS system there is some configuration work that needs to be done.

For some examples on how to connect to the service, see: FEWS PI-XML SOAP Examples. For some sample SOAP request please see FEWS PI SOAP Web Service Request examples.

PI SOAP Web Service API

Description of the methods provided by the PI SOAP Service API.

Getter methods

getTimeZoneId

String getTimeZoneId(String piVersion);

Get ID of Configured timezone for the webservice.

getFilters

String getFilters(String filterId, String piVersion);

Retrieve Pi Filters configuration from the Fews instance hosting the current FewsPiService.

The PiVersion defines the format of the return file content. If omitted the
latest version of the Pi file format will be used. (Expected 1.9 or higher)

getLocations

String getLocations(String clientId, String filterId, String piVersion);

Retrieve Pi Locations file containing all locations that are available for the passed 'filterId' argument.
If argument 'null' is passed then all locations configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getLocationsAsStream

DataHandler getLocationsAsStream(String filterId, String piVersion);

Retrieve Pi Locations file containing all locations that are available for the passed 'filterId' argument.
If argument 'null' is passed then all locations configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getParameters

String getParameters(String clientId, String filterId, String piVersion);

Retrieve Pi Parameters file containing all parameters that are available for the passed 'filterId' argument.
If argument 'null' is passed then all parameters configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getParametersAsStream

DataHandler getParametersAsStream(String filterId, String piVersion);

Retrieve Pi Parameters file containing all parameters that are available for the passed 'filterId' argument.
If argument 'null' is passed then all parameters configured in the pre-defined filter will be returned.
The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesHeadersForFilter

String getTimeSeriesHeadersForFilter(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean useDisplayUnits, String piVersion);

Read the timeseries header information from the webservice. Returns a pi timeseries xml file containing the timeseries headers information belonging to the filter defined by the 'filterId'.
Retrieve the timeseries data using the method getTimeSeriesForFilter

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesHeadersForFilter2

String getTimeSeriesHeadersForFilter2(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean useDisplayUnits, String ensembleId, String piVersion);

Read the timeseries header information from the webservice. Returns a pi timeseries xml file containing the timeseries headers information belonging to the filter defined by the 'filterId'.
Retrieve the timeseries data using the method getTimeSeriesForFilter

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).


getTimeSeriesForFilter

String getTimeSeriesForFilter(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean convertDatum, boolean useDisplayUnits, String piVersion);

Returns a pi timeseries xml file containing the timeseries data belonging to the filter defined by the 'filterId'.
The 'convertDatum' argument is to allow timeseries that support a global datum to have their values converted from a value relative to the location height to an absolute value.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesForFilter2

String getTimeSeriesForFilter2(String clientId, Date startTime, Date timeZero, Date endTime, String filterId, String[] locationIds, String[] parameterIds, boolean convertDatum, boolean useDisplayUnits, String ensembleId, String piVersion);

Returns a pi timeseries xml file containing the timeseries data belonging to the filter defined by the 'filterId'.
The 'convertDatum' argument is to allow timeseries that support a global datum to have their values converted from a value relative to the location height to an absolute value.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeries

String getTimeSeries(QueryParams queryParameters);

QueryParameters is defined by following schema definition:

<xs:complexType name="queryParameters">
    <xs:sequence>
    	<xs:element name="convertDatum" type="xs:boolean"></xs:element>
		<xs:element name="endCreationTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="endForecastTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="endTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="ensembleId" type="xs:string"></xs:element>
		<xs:element name="externalForecastTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="filterId" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="forecastSearchCount" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="importFromExternalDataSource" type="xs:boolean"></xs:element>
        <xs:element name="locationIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
		<xs:element name="omitMissing" type="xs:boolean"></xs:element>
		<xs:element name="onlyHeaders" type="xs:boolean"></xs:element>
		<xs:element name="parameterIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"></xs:element>
		<xs:element name="piVersion" type="xs:string" minOccurs="0"></xs:element>
		<xs:element name="showStatistics" type="xs:boolean"></xs:element>
        <xs:element name="showThresholds" type="xs:boolean"></xs:element>
		<xs:element name="startCreationTime" type="xs:dateTime" minOccurs="0"></xs:element>
		<xs:element name="startForecastTime" type="xs:dateTime" minOccurs="0"></xs:element>        
        <xs:element name="startTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="useDisplayUnits" type="xs:boolean"></xs:element>
    </xs:sequence>
</xs:complexType>

Returns a pi timeseries xml file containing the timeseries data belonging to the query parameters defined in the query parameters object.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getTimeSeriesAsStream

DataHandler getTimeSeriesAsStream(QueryParams queryParameters);

Same as getTimeSeries method except this method returns a DataHandler using the MTOM protocol.

getWorkflows

String getWorkflows(String piVersion);

Retrieve Pi Workflow file containing all workflows that can be run using the method runTask.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.9 or higher).

getSamplesAsStream

DataHandler getSamplesAsStream(SampleQueryParams sampleQueryParams);

Returns a pi samples xml file containing the sample data matching the query parameters. Since FEWS2016.01.

SampleQueryParameters is defined by following schema definition:

<xs:complexType name="sampleQueryParameters">
<xs:sequence>
<xs:element name="endCreationTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="endTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="filterId" type="xs:string" minOccurs="0"/>
<xs:element name="locationIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="omitMissing" type="xs:boolean"/>
<xs:element name="onlyHeaders" type="xs:boolean"/>
<xs:element name="parameterIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="qualifierIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="sampleIds" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="startCreationTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="startTime" type="xs:dateTime" minOccurs="0"/>
<xs:element name="version" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

Returns a pi samples xml file as DataHandler using the MTOM protocol containing the sample data belonging to the query parameters defined in the query parameters object.

The PiVersion defines the format of the return file content. If omitted the latest version of the Pi file format will be used. (Expected 1.21 or higher).

Since all parameters are optional, some defaults are chosen for the search period in case no search period or creation period was specified. The following rules apply:

getModifiers

String getModifiers(Date startTime, Date endTime, String modifierTypeId);

If no startTime and endTime are given, the search period is any time.

getTimeSeriesModifiers

String getTimeSeriesModifiers(Date startTime, Date endTime, String userId, boolean active, String[] locationIds, String[] moduleInstanceIds, String[] userDefinedDescriptions, String modifierTypeId);


Get a list of all timeSeries modifiers

Setter methods

putTimeSeriesForFilters

void putTimeSeriesForFilters(String clientId, String filterId, String piTimeSeriesXmlContent, byte[] piTimeSeriesBinaryContent, boolean convertDatum);

Write timeseries data to the FEWS system using the timeseries sets defined by the filters.

For performance reasons it is possible to split the timeseries header information from the timeseries data. The header information is stored in the piTimeSeriesXmlContent and the timeseries data is stored in the piTimeSeriesBinaryContent. If both header information and data is stored in the XML content the the 'piTimeSeriesBinaryContent' argument can be null.

The 'convertDatum' argument is to allow timeseries that support a datum to have their values converted to a value
relative to the location height. If values are already relative to location then enter FALSE or omit.

The endpoint accepts a time format with or without milliseconds, and automatically recognises the correct format.

Example:

<event date="2018-02-12" time="09:15:00.000" value="0.186" flag="2"/>
<event date="2018-02-12" time="09:16:00.250" value="0.186" flag="2"/>


<event date="2018-02-12" time="09:15:00" value="0.186" flag="2"/>
<event date="2018-02-12" time="09:16:00" value="0.186" flag="2"/>

putModifiers

void putModifiers(String piModifiersXmlContent, boolean commitModifiers, boolean deleteAllModifiers);

The method can be used to upload new modifiers to a FEWS system by using a xml file. The option commitModifiers indicates if the modifiers are committed are not after the upload.

Run methods

runTask

String runTask(String clientId, String workflowId, Date startTime, Date timeZero, Date endTime, String coldStateId, String scenarioId, String piParametersXml, String userId, String description);

Runs a workflow task for a given workflowId. Returns a handle to the task in the form of a taskid. This taskId can be used to track the status of the workflow using method call getTaskRunStatus. Additionally there are a few arguments that can be passed to control the run.

runTaskWithRunParameters

String runTaskWithRunParameters(RunParameters runParameters);

RunParameters is defined by following schema definition:

<xs:complexType name="runParameters">
    <xs:sequence>
        <xs:element name="coldStateId" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="description" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="endTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="piModuleParametersXml" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="startTime" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="timeZero" type="xs:dateTime" minOccurs="0"></xs:element>
        <xs:element name="useColdState" type="xs:boolean"></xs:element>
        <xs:element name="workflowId" type="xs:string" minOccurs="0"></xs:element>
        <xs:element name="whatIfId" type="xs:string" minOccurs="0"></xs:element>
     </xs:sequence>
</xs:complexType>

Runs a workflow task for a given workflowId. Returns a handle to the task in the form of a taskid. This taskId can be used to track the status of the workflow using method call getTaskRunStatus. Additionally there are a few arguments that can be passed to control the run.

getTaskRunStatus

String getTaskRunStatus(String taskId, long maxWaitMillis)


Runs a workflow task for a given workflowId. Returns a handle to the task in the form of a taskid. This taskId can be used to track the status of the workflow using method call getTaskRunStatus. Additionally there are a few arguments that can be passed to control the run.

Installing a Tomcat Fews PI Service

N.B.: The DAC installation has become obsolete since FEWS 2017.02.

The file DAC installation guide (final).doc describes how to install a Tomcat instance containing a DataAccessComponent instance. Once these steps are completed the FewsPiService.WAR can be deployed using a context xml file such as FewsPiService.xml.

Configuration

N.B.: The DAC configuration has become obsolete since FEWS 2017.02.

The are two levels of configuration. The first is the DataAccessComponent which is a FEWS client hosted as a GlobalResource in Tomcat. The DataAccessComponent uses the regular FEWS configuration which falls outside the scope of this documentation. The second level of configuration is what is used by the FewsPiService webservice which has been deployed in Tomcat. To deploy this webservice a context XML file is required which looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- Location of specific AI war file. (Can be a symlink) -->
<Context docBase="${catalina.home}/fews/FewsPiService.war" antiJARLocking="true" crossContext="true" >
    <!—- 'clientConfigFileId' points to a FEWS configuration file in de FEWS configuration directory 'PiClientConfigFiles'. -->
     <Parameter name="clientConfigFileId" value="FewsPiService.properties" override="false"/>
    <!—- resourceId must match the 'name' of 'ResourceLink' below -->
     <Parameter name="resourceId" value="DAC" override="false"/>
     <Parameter name="serviceName" value="FewsPiServiceImpl" override="false"/>
     <Parameter name="namespaceUri" value="http://fewpiservice.wldelft.nl" override="false"/>
     <Parameter name="portName" value="FewsPiServiceImplPort" override="false"/>
    <!—-  'fewspi_config_naam' must match the file name of this configuration file without the XML extension. -->
     <Parameter name="wsdl" value="http://localhost:8080/FewsPiService/fewspiservice?wsdl" override="false"/>
    <!—-  Global 'fews_dac' must be the same as the DAC resource name in the file 'server.xml'-->
     <ResourceLink name="DAC"
                  global="fews_dac"
                  type="nl.wldelft.fews.system.data.dac.DataAccessComponent"/>
     <Loader loaderClass="nl.wldelft.fews.system.data.dac.DacClassLoader" delegate="true"/>
</Context>

In the above configuration example you see a number of 'Parameter' values which will be explained below:

The next parameters have been added for the FewsPiService test page. This is the page that appears when browsing to the root URI of the FewsPiService. Technically these parameters would not be required, but because it is a 'test' page, the configuration has not been optimized yet.

FEWS Client Config File (clientConfigFileId)

This is a simple text configuration file that is located in the FEWS configuration in the directory:

%REGION_HOME%/Config/PiClientConfigFiles/FewsPiService.properties

In the above example the clientConfigFileId would be FewsPiService.properties.

N.B.: Since FEWS 20170.2 the clientConfigFileId can no longer be configured and should always be called FewsPiService.properties.

For more information about the possible properties, see FEWS Web Services Configuration FewsPiService.properties (deprecated since 2022.02).

Example SOAP calls

See soap-example-calls.zip for examples SOAP client calls.