Goal
I want to use FME-server as endpoint for sensordata (senML). This sensordata is posted from the sensors to our server with JSON as body.
Situation
I created a workspace which is comparable with the posts as described in these posts and everyting related to this
- https://knowledge.safe.com/articles/1295/send-source-data-to-fme-server-with-http-post.html
- https://knowledge.safe.com/questions/35741/how-do-you-initiate-a-job-submitter-service-via-ht.html
The last URL also contains my question from earlier today, but I got advised to create a new topic.
In short my workspace contains:
- a textfile reader with the setting 'read the whole file at once'
- some transformers to interprete the json
- postgis writer
The workspace works perfectly when running from my computer with FME workbench.
I uploaded the workspace to FME-server, using the jobsubmitter as service and in the settings of the service I pointed to the reader (Send HTTP Message Body to Reader)
Problem/testing
I'm using Postman to test posting the data. My http post contains the required headers and token certification, so this is no issue. In my FME-server job I can see that it is trying to run the job. But when checking the logfile, I get the following error:
Text File Reader: Source dataset 'P:\Projecten\Nijmegen\Nijmegen BMON
Ontzorging VSMS 301474\4. FME\SampleJson.txt' does not exist
Posted data (body which is an exact copy of the contents of my textfile-reader)
{
"type": "SenMLPackPayload",
"senMLPack": [
{
"bn": "urn:dev:com.sensoterra:18000167260",
"bt": 1532089461
},
{
"n": "soilmoisture",
"u": "%vol",
"v": 11.4,
"depth": 15
}
]
}
Conclusion/Question
So, to conclude; although I think I followed all the steps, FME-server
still tries to read the original file-data instead of the body/content
of the HTML POST.
Is there anyone who know why this is happening?
Some extra information:
- POST is allowed according to the CORS-settings
- I tried yesterday using FME 2018.0 and today using the brandnew 2018.1
- I tried changing the original reader to a filereader to see if this makes any difference
- In the final situation the data is posted to our server by another party. So I'm not able to influence the content of the post. (So I cannot change the content of the json to an workspace-parameter/attribute)