If this is an answered question, please excuse me and point me in the right direction.
I'm working on a web-based system that leverages FME server to run serveral tasks and provides the result to the user.
By programatically building parameters and calling the FME Server data download endpoint at
$"{repository.Url}/fmedatadownload/{repository.RepositoryName}/{analysis.WorkspaceId}";
and setting the parameter opt_servicemode to sync I get a response on the form:
{
"serviceResponse":{
"jobID":10261,
"statusInfo":{
"mode":"sync",
"status":"success"
},
"fmeTransformationResult":{
"fmeEngineResponse":{
"outputLocation":"C:\\\\ProgramData\\\\Safe Software\\\\FME Server\\\\resources\\\\system\\\\temp\\\\engineresults\\\\FME_176D3A2A_1504696983768_3368.zip",
"resultRootDir":"/fmedatadownload/results",
"statusNumber":"0",
"logFileName":"job_10261.log",
"downloadUrl":"http://server/fmedatadownload/results/FME_176D3A2A_1504696983768_3368.zip",
"numFeaturesOutput":"49",
"statusMessage":"Translation Successful",
"notificationLocation":"C:\\\\ProgramData\\\\Safe Software\\\\FME Server\\\\resources\\\\system\\\\temp\\\\engineresults\\\\FME_176D3A2A_1504696983768_3368_nw"
},
"fmeServerResponse":{
"request":"\\" Samples/austinApartments/austinApartments.fmw\\" -XML_PARAMETER <?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>\<TRANSFORMATION_REQUEST><PUBLISHED_PARAMETER name=\\"FME_SERVER_REQUEST_HEADERS\\"> {
\\"remote-addr\\":\\"192.168.46.110\\",
\\"host\\":\\"192.168.4.148\\"
} <\\/PUBLISHED_PARAMETER><PUBLISHED_PARAMETER name=\\"FME_SERVER_REQUEST_URI\\">http://server//fmedatadownload/Samples/austinApartments.fmw<\\/PUBLISHED_PARAMETER><PUBLISHED_PARAMETER name=\\"FME_SERVER_REQUEST_PARAMETERS\\"> {
\\"opt_responseformat\\":\\"json\\",
\\"opt_servicemode\\":\\"sync\\"
} <\\/PUBLISHED_PARAMETER><\\/TRANSFORMATION_REQUEST> --FME_SECURITY_USER \\"admin\\" --FME_SECURITY_ROLES \\"fmeadmin fmesuperuser\\" --FME_SERVER_HOST \\"localhost\\" --FME_SERVER_PORT \\"7071\\" --FME_SERVER_WEB_URL \\"http: //192.168.4.148:80 \\" -OGCKML_1_DATASET \\"!FME_AUTO_DIR_NAME!.zip\\\\austinApartments.kml\\"",
"jobStatus":"SUCCESS",
"timeRequested":"Wed-06-Sep-2017 01:23:03 PM",
"requestKeyword":"FILE_DOWNLOAD_SERVICE",
"description":"",
"timeStarted":"2017-09-06 01:23:03",
"requesterHost":"192.168.4.148",
"priority":"100",
"result":"0:Translation Successful|NotificationLocation=C:\\\\ProgramData\\\\Safe Software\\\\FME Server\\\\resources\\\\system\\\\temp\\\\engineresults\\\\FME_176D3A2A_1504696983768_3368_nw|OutputLocation=C:\\\\ProgramData\\\\Safe Software\\\\FME Server\\\\resources\\\\system\\\\temp\\\\engineresults\\\\FME_176D3A2A_1504696983768_3368.zip|ResultRootDir=/fmedatadownload/results|NumFeaturesOutput=49|LogFileName=job_10261.log|downloadUrl=http://server/fmedatadownload/results/FME_176D3A2A_1504696983768_3368.zip",
"requesterResultPort":"55697",
"resultSuccess":"true",
"serviceSuccess":"true",
"id":"10261",
"timeFinished":"2017-09-06 01:23:04",
"serviceMsg":""
}
},
"url":"http://server/fmedatadownload/results/FME_176D3A2A_1504696983768_3368.zip"
}
}
Downloading the result at url works as expected.
However. As far as my understanding of FME server goes, under heavy loads things are queued up. This means that a job submitted to the DataDownload endpoint might "run" for more than 10 minutes. This would make the HTTP request time out.
Because of this I'm thinking that opt_servicemode = async is a better solution. If I set this, the response I get is:
{ "serviceResponse":{ "jobID":10266, "statusInfo":{ "mode":"async", "status":"success" } }}
That is, almost no info. But I do get a jobID, so I'm guessing that this serves as a reference to the job.
And, indeed, if i navigate my browser to http://server/fmeserver/#/job/10266/summary i see a "Data DownloadURL" on top of the page, as well as in the "Result Data" section at the bottom of the page.
However, i cannot find this url in either the response to the DataDownload request, neither as a response to any of the endpoints at http://server/fmerest/v2/transformations/jobs/id/10266
So, my questions are basically:
1) How is the data download endpoint supposed to work in async mode? Am I supposed to get a link somehow?
2) Where is the data-download-link provided?
NOTE: The sync download works as expected, but this is not the problem I'm trying to solve. I am also aware that FME server can send the result by email if I specify opt_requesteremail, but this is not what I want either.
Any answers or pointers welcome.