SWIM Webservices Tutorial
SWIM RESTful webservices are implemented using Dropwizard. The current version exposes an endpoint that receives a user scenario specification in JSON format (see data model view for additional information on the user scenario JSON schema).
SWIM currently connects to the March 26 2019 version of the Bucket Model developed with GAMS.
Bucket Model Execution Endpoint
Endpoint URL: https://services.cybershare.utep.edu/water/distributor/
Water Balance Model Execution Endpoint (Prototype)
Endpoint URL: https://services.cybershare.utep.edu/swim-scilab/runmodel/
Note: The following section is outdated... stay tunned for new sample files to try out our webservices!
To try out our webservice by downloading a JSON input sample here. (Pending new sample update).
The service can be requested programmatically or via clients with HTTP request capabilities. As a sample we show how to invoke the webservice using the Rest Web Service Client chrome extension which can be installed in google chrome here
Once integrated into chrome configure the request options as following:
Copy the sample user scenario input JSON into the request body.
- Click on the send button.
- If the execution is successful the service will return a code 200 with an extended JSON as a response and the status attribute as “complete”.
- The returned JSON will contain additional attributes such as startedAtTime, endedAtTime and status.
- The model output object will include the attribute “varValue” which contains a data structure with generated results for each output variable.
- Webservice error handlers:
- Input validation.
- Missing fields.
- Parameter values out of bounds.
- Model execution errors.
 DropWizard - http://www.dropwizard.io/1.1.4/docs/
 Maven - https://maven.apache.org/
 Gams - The General Algebraic Modeling System - https://www.gams.com/  Scilab - Scilab - https://www.scilab.org/