I have an functional EMS with LSR running in a Linux Docker-container which is connected to my Thingworx platform; it's working fine so far. Currently I'm trying to configure a Remote-Thing which contains a service that executes HTTP requests to an third-party endpoint. So that I can lookup the resulting data in my Thingworx platform.
My problem is, that I don't know how to write an REST requests with the libraries given with the LSR. The examples of Lua-REST calls that I've found so far require additional libraries (or modules) of which I also don't know how to implement them in the EMS/LSR environment.
Does anyone have an working example of an remote thing with an defined service that executes a simple http-requests? Is this even possible with the standard LSR or does it need additional modules?
Solved! Go to Solution.
No, I'm not familiar at all with .lua.
The reason for using .lua for this is simply for not knowing another way. I've followed the documentations and guides that orchestrate .lua functionality to create services/properties for remote things. So I'm under the impression that this is the recommended/easiest way when working with the EMS.
It seems fairly self-explanatory so far... define a service with proper in- and output and say what the service should do. As an workaround I currently execute shell-scripts that are executing the HTTP-Request and return the data to my lua template. But I would like to have it all in .lua itself and just would like to know if this is even possible with the given LSR functionality. And if so: How.
If the previous response helped you to find a solution, please mark it as the Accepted Solution for the benefit of others with the same question. If you have found another solution to your problem, please post it here.
it didn't really answered my question but I'm slowly getting to understand that the SDKs (i.e. Java) basically serve the same purpose and might be more useful for my case.