LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

REST interface

I am looking at quite a lot of (almost) new webservices that come with REST API's. I am very interested in finding out how to interface with this type of API. I think it will quickly overtake webservices (using SOAP, WSDL) as the protocol of choice. The interface seems really simple (for example a HTTP get request), but I am not so sure how to set it up.
I am hoping other people might be interested to look into subject.

I know the internet toolkit at least support receiving get request with CGI functions. HTTP GET calls are normally performed by the browser, so I don't believe there are any VI's that can quickly perform this function. Furthermore, the function should also be able to support SSL to be really useful.


0 Kudos
Message 1 of 13
(8,226 Views)
Hi Aartjan
 
The internet toolkit also contains a HTTP GET VI, the URL Get HTTP Document.vi should be able to retrive the responce from a resource.
 
REST is not a protocol but more of a architecture, it's for example closer to the client server architecture then to a protocol. but it does use protocols and standards like HTTP and XML.
 
The basic idee as i understand it is that REST would define resources that return information. For example a resource like http://www.ni.com/products could return a xml document containing all NI's products where as http://www.ni.com/products/PCI-6221 would return a document with product information  about the PCI-6221 Data acquisition board.
 
Hope this helps,
Thanks
Karsten


Message Edited by KvZ on 03-11-2008 03:28 PM
0 Kudos
Message 2 of 13
(8,205 Views)
aartjan,

For starters, you might want to check out EasyXML.  It ships with an example that reads an XML rss feed of the LAVA discussion forum.  This example uses datasocket to read the data at the URL.  This isn't a total REST solution, but it's a nice start 🙂

Thanks,

-Jim
JKI Blog
0 Kudos
Message 3 of 13
(8,191 Views)
Jim, there is no way I am not buying your new toolkit. I've been craving (ahhh) for that tool!
I realize my question was somewhat ambiguous, but at least now people can search for 'REST' and actually find something on this forum.
I want to give it a shot at some point. Running a http get call indeed is not such a big deal, but current NI tools will not support other REST commands (PUT, POST, DELETE). But really, I am just poking to see what happens here..

thanks guys
aartjan

0 Kudos
Message 4 of 13
(8,173 Views)


@aartjan wrote:
Jim, there is no way I am not buying your new toolkit. I've been craving (ahhh) for that tool!
I realize my question was somewhat ambiguous, but at least now people can search for 'REST' and actually find something on this forum.
I want to give it a shot at some point. Running a http get call indeed is not such a big deal, but current NI tools will not support other REST commands (PUT, POST, DELETE). But really, I am just poking to see what happens here..

thanks guys
aartjan




aartjan,

That's great to hear.

I know exactly what you are talking about -- no ambiguity in my mind.  I've been doing some small work with REST interfaces for a while.  EasyXML is part of what came out of that work.

I'm looking forward to your feedback on EasyXML, once you give it a try.  I'd also be interested to hear what sorts of web services you're interested in communicating with.

-Jim



Message Edited by Jim Kring on 03-14-2008 08:45 AM
JKI Blog
0 Kudos
Message 5 of 13
(8,156 Views)

Does anyone know if any of the other REST commands will be supported in the Internet Toolkit? I was looking at creating my own Twitter App, i can get the public timeline and my friend timeline etc but without POST I cannot update my status. I tried importing some of the open source DLL's that have been created but I can't get that working either.

 

Robin

0 Kudos
Message 6 of 13
(7,898 Views)
Hi Roger,

As of LabVIEW version 8.6 there is build in support for some RESTful commands in the Web Services (you need at least a Full version of LabVIEW). I have been looking around and found the following pages from the LabVIEW 8.6 Help file:
LabVIEW Web Services (Windows)
Interacting with Web Method VIs (Windows)
Configure RESTful VI Dialog Box


I hope this will provide you with the requested information!

Good luck with your application.

Best regards,
Peter
Message 7 of 13
(7,870 Views)

Thanks for the info, but it seems that these are all about creating your own web service rather than talking to someone else's. The POST documentation is about receiving a post command and what to do with it.

 

Good reading though.

 

Robin

0 Kudos
Message 8 of 13
(7,864 Views)

Hi Robin,

 

I have been checking out for information on the client side of RESTfull support within LabVIEW. There have been more requests about this and also a Product Suggestion has been created for this. This means the LabVIEW Developers might implement it in a later version of LabVIEW.

 

When this will be exactly, I cannot tell, since I don't know it as well.

 

We just have to wait until R&D will respond on this product suggestion.

 

Best regards,

 

Peter S

0 Kudos
Message 9 of 13
(7,843 Views)

I noticed this was dated late 2008.  I'm wondering if you've since found a solution.  I too want to do POSTing, and client-side processing.  Everything I've seen from labVIEW is from the server side.  Since LabVIEW hasn't developed anything for client-side yet, how did you resolve this (hopefully you have).  This is what I'm trying to figure out...Let me know if you have any thoughts.  This is probably the third time I've posted this question, so I apologize.

 

What we have now is a server that (over secure link) sends html (web pages) to a client that (using Internet Explorer) displays these pages.  The user enters button clicks, data, to command the server to do certain tasks.   The server and client code were written by a third party.  Now, WE are supposed to develop our own client such that the server (over this same secure link, using SSL/TLS) is going to send me XML instead of html.  I'm supposed to parse this XML and generate a http request using POST method (I saw where LabVIEW Web Server uses PUT and DELETE) and the web server will respond with HTTPS containing XML response (etc). I plan on using easyXML from JKI Software to parse the XML, but that's about as far as I got.  I think I need to use the TCP/IP Open Connection, etc to establish the server communication, but I'm not sure how to handle the secure-link aspects.  I’ve seen mentioned using stunnel - I've also seen QT Framework, and Visual C++ suggested as I think it has similar MFC classes that support http implementation.  To throw another variable into this ... I'm used to using TestStand to sequence through all my LabVIEW tests.  I'm having a very difficult time conceptualizing (if that's a word) how this secure link is going to be "kicked off" by TestStand, but handled by LabVIEW and stunnel (or equivalent). 

 

0 Kudos
Message 10 of 13
(7,505 Views)