Hi, I am trying to run the attached fme workspace in fme server as datastreaming service. The workspace works fine in FME Workbench and while running in FME server web interface as datastreaming service. However, I am trying to access this service from my web app. Below is how I am forming the request :
var httpRequest = new XMLHttpRequest();
httpRequest.open("POST", url, true);
httpRequest.setRequestHeader("Authorization","fmetoken token=*********")
httpRequest.setRequestHeader("Access-Control-Allow-Origin", "http://localhost:8080");
httpRequest.setRequestHeader("Accept","application/json;charset=UTF-8");
httpRequest.setRequestHeader("content-Type","application/x-www-form-urlencoded");
httpRequest.onreadystatechange = function()
{
if (httpRequest.readyState == 4 && httpRequest.status == 200)
{
console.log(httpRequest.responseText);
}
}
// send a request so we get a reply
httpRequest.send("data="+JSON.stringify(dataToBesent.toGeoJSON()));
}
This throws an Error - Unexpected character: 't'. One of the following characters was expected: '"', '}' " in the log file.
Below is the object dataToBeSent
{"type":"FeatureCollection","features":o{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":ot402,406.567505],0416,276.542479]]}},{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":ot458,398.565965],6466,220.531699]]}},{"type":"Feature","properties":{},"geometry":{"type":"LineString","coordinates":ot514,405.567313],1498,188.525539]]}}]}
Has anyone encountered such a problem previously?
Below is a Snap of the completed job details. The JSON is inserted properly but still throws an error 😞 .