cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

EMS HTTP Requests with LSR

DanZ
15-Moonstone

EMS HTTP Requests with LSR

Hi,

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?

ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:smainente)

Hi @DanZ.

 

Have you taken a look at the other SDK's we have available that you might be more comfortable with?  Here is a link to the page where you can access more information.

 

Regards.

 

--Sharon

View solution in original post

5 REPLIES 5
smainente
16-Pearl
(To:DanZ)

Hi,

Do you have a specific requirement to use LUA to implement such functionality ? Is it because you are familiar with the language ?

DanZ
15-Moonstone
(To:smainente)

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.

slangley
23-Emerald II
(To:smainente)

Hi @DanZ.

 

Have you taken a look at the other SDK's we have available that you might be more comfortable with?  Here is a link to the page where you can access more information.

 

Regards.

 

--Sharon

slangley
23-Emerald II
(To:slangley)

Hi @DanZ.

 

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.

 

Regards.

 

--Sharon

DanZ
15-Moonstone
(To:slangley)

Hi Sharon,

 

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.

 

Thank you

Announcements


Top Tags