Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

The Fews Workflow Runner service uses XFire, a java SOAP framework. This framework allows a client application to obtain a proxy instance to the FewsWebServiceRunner API. With this API the client can run workflows on the MC from the client code. The timeseries produced by the workflow run can read by the client application. Before a client application can access the FEWS system there is some configuration work that needs to be done.

Warning

Parallel processing functionality from 2017.01 (<multipleForecastingShells>true</multipleForecastingShells>) is currently not possible via this service.

 

(warning) User's looking to use XFire on a new project, should use CXF instead. CXF is a continuation of the XFire project and is considered XFire 2.0. It has many new features, a ton of bug fixes, and is now JAX-WS compliant! XFire will continue to be maintained through bug fix releases, but most development will occur on CXF now. For more information see the XFire/Celtix merge FAQ and the CXF website.

...

Description of the methods provided by the Fews Workflow Runner Service API.

Code Block

TimeSeries[] runFewsWorkflow(String clientId, String workflowId, Date forecastStartDateTime,
                 Date forecastDateTime0, Date forecastEndDateTime, TimeSeries[] inputTimeSeries)
                 throws Exception;

...

The MC Service component is started up by the MC (TaskWebServiceRunner). The client application does not use this service directly. The only configuration required for this component is that the following line is added to the MC configuration file; fews.master.mc.conf.

Code Block

<webservice port="8899" sleeptime="15" timeout="600"/>

...

  • port: This is the port number on which the FewsWebService will be hosted. This port must be accessible by the client application.
  • timeOutSeconds: This is the length of time that the FewsWebService will wait for the workflow to complete runnging.
  • inputPiTimeSeriesFile: This is the file from which the MC workflow run will read the input timeseries. When calling the FewsWebService API the timeseries passed as argument will be written to this file. This file must therefore match the file configured in the MC workflow.
  • Wiki Markup*outputPiTimeSeriesFile \ [1..>*: These are the files to which the MC workflow will write the output timeseries. When calling the FewsWebService API the timeseries are read from the output files after the workflow run is completed. These timeseries are returned by the call. These files must therefore match the files configured in the MC workflow.
  • mcTaskWebService: This contains information that allows the FewsWebService to connect to a specific running instance of the McTaskWebService. Although this entry is optional it is required!

...

Step 1: Install the webservice package.TODO: Attach the webservice package!

Step 2: Make a new FewsWebService.exe and FewsWebService.jpif file in the \bin directory. The FewsWebService.jpif must contain the following information.

Code Block
..\jre

...


-mx512m

...


-cp

...


$JARS_PATH$

...


nl.wldelft.fews.webservice.FewsWebServiceRunner

...


<path>/WebService.xml

Step 4: Start the FewsWebServiceRunner by clicking on the FewsWebServiceRunner.exe.

Step 5: Stop the FewsWebServiceRunner by killing the application using the System Monitor.

Install windows service

TODO: Package not available!

Starting on Linux

Step 1: Install the webservice package.TODO: Attach the webservice package!

Step 2: Set the correct paths in the fews_webservice.sh script.

...

Anchor
Example FewsWebService
Example FewsWebService

Setting up a connection

Code Block
ObjectServiceFactory serviceFactory = new ObjectServiceFactory();
Service service = serviceFactory.create(FewsWebService.class);
XFireProxyFactory proxyFactory = new XFireProxyFactory();
 //port Number must be equal to the number configured in the WebService.xml
int portNumber = 8100;
//localhost can be replaced by the ip address of the machine on which the WebService is running.
FewsWebService serviceProxy = (FewsWebService) proxyFactory.create(service, "http://localhost:" + portNumber + "/FewsWebService")

Running Workflows

Code Block
FewsWebService proxy = getProxy(); //See section "Setting up a connection"

TimeSeries[] inputArrays = getInputArrays(); //Get the timeseries required to run workflow.

//Run a workflow
try {
TimeSeries[] outputArrays = proxy.runFewsWorkflow("MyWebService", "workflowId", new Date(0), new Date(0), new Date(0), inputArrays);
} catch (Exception e){
// do something.
}

Appendix

Anchor
WebService XSD
WebService XSD

...