Question

FME Data Streaming .json file (file just downloads)


Badge +6

We have FME Server 2018 on premise (Express Installation). I am trying out the Data Streaming FME Server web service to make a .json file available to out web developer to build an app. I am having trouble getting the Data Streaming service to work. After publishing to FME Server with the Data Streaming service enabled, I can run the job and it downloads the .json file as a file download to my browser. However, I want to be able to provide a url to the web developer to be able to query by feature id, etc. for that .json data that was output. Can someone please help me to understand how to make this happen? Thank you!


3 replies

Badge +2

Hi @sashalockamy

The data streaming service does this for json. If you build ab application that calls the data streaming url you will be able to work with the json response. You could test this using a http caller in fme to call your data streaming service and check the response.

I had this same issue. We wanted to use the Data Streaming service inside a web application, but the return was always a JSON file. To get around this use a JSONTemplater, JSONFormater and write it out to a text file.

See this thread for example of the solution:

https://knowledge.safe.com/questions/36195/can-you-modify-the-response-headers-for-a-data-str.html

The "DataStreaming" with "TEXTLINE" (text file) output seems to work. I used an "AttributeJSONPacker" compound transformer, set the "Packed Attribute Name" to "text_line_data," but still no success. It prompted for a text download. It finally worked once I deleted the "DestDataset" parameter under "User Parameters"->"Published Parameters" and then, when finally publishing to the FME Server, went into the "Edit..." properties of "Data Streaming" and made sure to add the TEXTLINE writer under the empty box for "Include Writers in Stream" It was not there by default. Maybe because I have been messing with this workbench and switching up output for a while. Now it writes straight to the browser. It may not as efficient this way, but it's what my non-spatial API users expect.

Reply