Hi all
I'm trying to test a workspace I've published in FME Cloud as a Job Submitter Service using an HTTP POST
to kick it off. I
think I’m missing something when trying to deliver the POST.
In my workspace I have a Textfile reader to read the JSON delivered in the POST body. All is set up as described in the Safe article 'Send Source Data to FME Server with HTTP POST'.
(https://knowledge.safe.com/articles/1295/send-source-data-to-fme-server-with-http-post.html)
This is what I’m trying to deliver:
{
"parameters":
{
"xmin":"148.88672",
"xmax":"149.61182",
"ymin":"-29.62122",
"ymax":"-29.11378",
"email":"john.smith@email.com"
},
"available_data":o
{
"source":"NSW",
"downloadables":{
"DEMs":{
"1 Metre":o
{
"file_url":"https://s3-ap-southeast-2.amazonaws.com/nsw/Bunarba_1m.zip"
}
]
}
}
},
{
"source" : "Geoscience Australia",
"downloadables" : {
"DEMs" : {
"1 Second" : ;
{
"file_url" : "https://s3-ap-southeast-2.amazonaws.com/ga/144fdd4fa6.zip"
}
],
"5 Metre" : ;
{
"file_url" : "https://elvis.ga.gov.au.s3.amazonaws.com/ga/adelongtown0112.tif"
}
]
}
}
}
]
}
Originally we were going to include all the json elements in the url but reconsidered due to the potential length of the encoded json.
'm trying to use Postman (https://www.getpostman.com/) to send the JSON to the FME Cloud service.
For the headers I've set 'Accept' and 'Content-Type' to 'application/json' . The jobs get started in FME
Cloud but the content in the POST body doesn’t seem to be delivered so the FME
reader fails because it receives no content.
The status return in Postman is: 422 Unprocessable Entity.
When I send the POST, the workspace runs but fails with the error:
Text File Reader: Source dataset 'C:/ELVIS/FSDF/POST_example.txt' does not exist
When I published the workspace I set the 'Send HTTP Message Body to Reader' Service Property to my text file reader so it should use the POST body as the input instead of the path defined in the reader. Doesn't seem to be working though so I thought that maybe the json in the message body isn't getting through.
Any thoughts?
Update:
I've been trying to test a simple workspace to try and get the JSON transferred from the POST to the workspace (see posttest.fmw and post-example.txt - the json I'm trying to deliver).
I no longer think it's a problem with the workspace as I've tested the posttest service via another workspace using an HTTPCaller to execute the POST and all works as expected. I see the contents of the POST body in the log file of the test workspace.
So, it must be a settings issue or something else I'm doing wrong with Postman. Maybe the proxy?