你在这里: Reference Manual > FME服务器Web服务 > 转型服务 > 数据下载服务

数据下载服务

数据下载服务为用户提供从工作区的输出作为可下载的zip文件。通常,该服务允许用户指定下载的数据层,格式和坐标系。

使用URL或表单请求此服务。例如:

http:///fmedatadownload/<存储库>/.FMW?<参数>

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.

这download is returned as a zip (compressed archive) file for the following reasons:

  • 这result is a number of output datasets (not just one dataset).
  • 基于文件夹的数据集不包括单个文件;例如,ESRI形式格式具有扩展名为.shpp,.shx,.dbf和其他一些文件。
  • 即使是基于文件的数据集也可能包含多个文件;例如,GML数据集包括GML文件和XSD(XML模式定义)文件。

笔记:从Workspace中写入多个数据集到扇孔目录的zip文件由包含单独数据集的多个文件夹组成。这些文件夹包含在一个文件夹中,其名称基于目的地扇出目录。

FME服务器还可以提供使用的输出不使用ZFIPPED数据流服务。

Data Upload Serviceworks in conjunction with the Data Download, Data Streaming, and职位提交者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.

笔记:您可能希望从工作区发布一些参数以控制来自URL或表单请求的转换。例如,要读取,输出坐标系和格式(通用写入器)的特征类型是在使用此服务时通常发布的参数。

Service Specific Request Parameters

姓名

Value

Description

OPT_RESPONSERFORMAT.

XML |杰森
Default: xml

响应的语言。文本必须是所有小写的。

opt_geturl 数据集的URL 用于转换的源数据集的URL
opt_showresult. 真实|错误的 XML / JSON响应是否包括FME转换结果。如果不存在此参数,则默认值为true。
Opt_ServiceMode. 同步|异步|日程

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.

或者,调度数据下载请求以在指定的开始时间运行(仅限一次性)。如果指定了计划,请参阅下面的其他参数。

opt_requesteremail 逗号分隔的电子邮件地址 Addresses to which the notification e-mail messages are sent.

通知指令

This service supports通知指令

Scheduling a Data Download Request

使用Opt_ServiceMode.=schedule,您可以在指定的开始时间安排数据下载请求以运行一次。需要以下附加参数:

姓名 Value Description
trigger runonce 表示作业计划运行一次。仅有的runonceis supported.
开始 <YYYY-MM-DD HH:MM:SS> 运行作业的日期/时间。如果日期/时间早于当前时间,则作业立即运行。
category <分类名称> 这姓名of the general category or group to which the task belongs.
姓名 <计划名称> 这姓名of the task. Names must be unique within a category. After a task scheduled to run once is finished, it is authomatically removed.
描述 <描述> 任务的描述。

使用Remote Data During a Request

使用HTTP POST数据的身体作为读者的数据集

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.

使用来自HTTP的数据作为读者数据集

此Web服务可以通过HTTP GET接收数据和覆盖读取器数据集。数据集应指定为URL并通过“opt_geturl”参数传递给服务。支持HTTP和FTP URL。如果工作空间中有多个读者,则需要指示哪些读者将使用临时文件。通过编辑服务注册,您可以在发布工作空间时表示您的选择。

例如,这里是使用远程KMZ数据集的服务请求:

http:///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:

元素

儿童元素

Value

Description

statusinfo.

信息

信息string

服务失败消息

status

success | failure

service status

mode

同步|async

service mode

fmeTransformationResult

fmeserverresponse.

FME服务器响应属性

FME服务器响应

fmeengineResponse.

FME引擎响应属性

FME发动机响应

电子邮件

没有

Email addresses

请求者的电子邮件地址

url

没有

URL字符串

用于下载结果数据集(zip)的URL

jobID

没有

job ID

当前的作业标识符

Enabling E-Mail Notifications

这data download service can send e-mail messages to notify you when a job completes successfully or unsucessfully. If a job completes successfully, the e-mail provides a clickable link or a zip file to download the data.

For more information, see配置FME服务器以发送电子邮件通知

也可以看看