I tried uploading a Ditto generated TD in a github gist, but it can't be parsed the right way. Looking at their implementation i think maybe it could be a issue with the fact that Ditto generates "nested" properties (Features in another TD).
speaked to the node-wot team, and i'm raising a github issue.
"outgoingScript"
of the configured JS payload mapper is then executed for the command responses (which also are Ditto Protocol messages, so the signature to implement is the same)
new EventSource('http://localhost:8080/api/2/things/com.project.thesis:greenhouse01/outbox/messages/subject', {withCredentials: true}).onmessage =
function (event){
if(event.data != ''){
console.log(event);
}
console.log(event);
//$('#eventParagraph').text(event);
}
curl -X 'POST' \
'http://localhost:8080/api/2/things/com.project.thesis%3Agreenhouse01/outbox/messages/subject?timeout=0' \
-H 'accept: */*' \
-H 'Authorization: Basic ZGl0dG86ZGl0dG8=' \
-H 'Content-Type: application/json' \
-d '"test"'
EventSource
attached to http://localhost:8080/api/2/things
where, if i understand the ditto SSE mechanism, i should receive all events. I'm quite sure that the way i send the messages is right, since i receive that via WebSocket. There is something i can do for debugging ?