Data Download Service
The Data Download Service provides users with the output from a workspace as a downloadable zip file. Typically the service allows users to specify the data layers, format and coordinate system for the download.
This service is requested using a URL or a form. For example:
http://<host>/fmedatadownload/<repository>/<workspace>.fmw?<parameters>
A web page opens with a link to a zip file containing the results of the workspace translation. In addition, an email can be sent with a link to the zip file.
The download is returned as a zip (compressed archive) file for the following reasons:
- The result is a number of output datasets (not just one dataset).
- Folder-based datasets do not consist of a single file; for example, ESRI Shape format has files with the extension .shp, .shx, .dbf, and some others.
- Even file-based datasets may consist of more than one file; for example, a GML dataset includes both a GML file and an XSD (XML Schema Definition) file.
Note: The zip file from workspaces that write multiple datasets to a fanout directory is comprised of multiple folders that contain the separate datasets. These folders are contained within a single folder whose name is based on the Destination Fanout Directory.
FME Server can also provide output that is not zipped by using the Data Streaming service.
The Data Upload Service works in conjunction with the Data Download, Data Streaming, and Job Submitter services to upload files.
Requirements
This service works with any workspace that writes single or multiple files. No published parameters are required. It is not possible to run a data download on a workspace whose destination is a database format.
Note: You may want to publish some parameters from your workspace to control the translation from the URL or form request. For example, feature types to read, output coordinate system, and format (generic writer) are commonly published parameters when using this service.
Service Specific Request Parameters
Name |
Value |
Description |
---|---|---|
opt_responseformat |
xml | json |
The language of the response. The text must be all lowercase. |
opt_geturl | The URL to a dataset | The URL of the source dataset to be used for transformation |
opt_showresult | true | false | Whether the XML/JSON responses include the FME transformation result. The default value is true if this parameter is not present. |
opt_servicemode | sync | async | schedule |
Toggles between synchronous and asynchronous modes of the service. When jobs are submitted asynchronously (async), the response of submission success or failure is returned immediately. When set to synchronous (sync), the response is not returned until the job completes. Or, schedules a data download request to run at a specified start time (one-time only). If schedule is specified, see below for additional parameters. |
opt_requesteremail | comma-separated email addresses | Addresses to which the notification email messages are sent. |
Notification Directives
This service supports Notification Directives.
Specifying the Notification Service topic to notify when a job succeeds or fails, respectively.
http://localhost/fmedatadownload/Samples/austinApartments.fmw?&nm_jobsuccess_topic=DATADOWNLOAD_ASYNC_JOB_SUCCESS&nm_jobfailure_topic=DATADOWNLOAD_ASYNC_JOB_FAILURE
Scheduling a Data Download Request
Using opt_servicemode=schedule, you can schedule a data download request to run once at a specified start time. The following additional parameters are required:
Name | Value | Description |
---|---|---|
trigger | runonce | Indicates the job is scheduled to run once. Only runonce is supported. |
start | <yyyy-MM-dd HH:mm:ss> | the date/time to run the job. If the date/time is earlier than the current time, the job runs immediately. |
category | <category _name> | The name of the general category or group to which the task belongs. |
name | <schedule name> | The name of the task. Names must be unique within a category. After a task scheduled to run once is finished, it is automatically removed. |
description | <description> | The description of the task. |
Using Remote Data During a Request
Using data from HTTP POST body as Reader dataset
This web service can receive data and override source dataset via HTTP POST. The content of the POST request body will be saved to a temporary file which will be used as the Reader dataset of the workspace. If there is more than one reader in the workspace, then you will need to indicate which reader will use the temporary file. You indicate your choice when publishing the workspace by editing the service registration.
Using data from HTTP GET as Reader dataset
This web service can receive data and override Reader dataset via HTTP GET. The dataset should be specified as a URL and passed to service by 'opt_geturl' parameter. Both HTTP and FTP URLs are supported. If there is more than one reader in the workspace, then you will need to indicate which reader will use the temporary file. You indicate your choice when publishing the workspace by editing the service registration.
For example here is a service request that uses a remote KMZ dataset:
http://<host>/fmedatadownload/Test/Viewer.fmw?opt_geturl=http://data.vancouver.ca/download/kml/elementary_school_boundaries.kmz
Response Elements
If the response format is specified as XML or JSON, a service response may contain the elements shown in the following table:
Element |
Child Elements |
Value |
Description |
---|---|---|---|
statusInfo |
message |
message string |
service failure message |
status |
success | failure |
service status |
|
mode |
sync | async |
service mode |
|
fmeTransformationResult |
fmeServerResponse |
FME Server response properties |
FME Server response |
fmeEngineResponse |
FME Engine response properties |
FME Engine response |
|
|
none |
Email addresses |
Requesters’ email addresses |
url |
none |
URL string |
URL used to download the result dataset (ZIP) |
jobID |
none |
job ID |
The current job identifier |
Enabling E-Mail Notifications
The data download service can send email messages to notify you when a job completes successfully or unsucessfully. If a job completes successfully, the email provides a clickable link or a zip file to download the data.
For more information, see Configuring FME Server to Send Email Notifications.
See Also