dante_34 Posted February 19, 2015 Report Posted February 19, 2015 Hello I have a problem with http VI’s and external web services (RESTful) and I’m using LabVIEW 2013. In NetBeans I create a project with a GET web service from a table in MySQL, so I use http VI’s for accessing the service (blog diagram .png), receiving the information in JSON (front panel.png) and took the information I needed (in this case the “slActualValue†value). I have a program that inserts new values in the database and in chrome the service works fine but if a want to do the Vi in a while loop to update or receive new values, the the next JSON data form the web service is the same as the first call, but if I go to the NetBeans project and do the deploy again the JSON data changes. I ask about this problem from the experts in web services (RESTful) and they say that is the cookies in the LabVIEW program, so I create add a cookie file .txt but im not confident about the format of the file(the example is in this post) or if there something amiss in the LabVIEW VI’s Cookie.txt file # Netscape HTTP Cookie File # http://curl.haxx.se/rfc/cookie_spec.html # This file was generated by libcurl! Edit at your own risk. UNKNOWN FALSE 10.18.9.32:8080/arto FALSE 0 ID 0 Quote
ShaunR Posted February 19, 2015 Report Posted February 19, 2015 Cookies are set by the server. You are just telling the labview client where to store it so whatever you put in there will be overwritten at some point. The data is probably being cached and you are getting the cached values. Try adding the folloing headers. Cache-Control : no-cache, must-revalidate, max-age=0 Pragma : no-cache Quote
dante_34 Posted February 23, 2015 Author Report Posted February 23, 2015 Hello I tried: add the headers in VI, in the web service, disable the cache form the glassfish server and activate pool, lower the timeout of the cache and pool, but until now nothing Cookies are set by the server. You are just telling the labview client where to store it so whatever you put in there will be overwritten at some point. The data is probably being cached and you are getting the cached values. Try adding the folloing headers. Cache-Control : no-cache, must-revalidate, max-age=0 Pragma : no-cache Quote
Jon Kokott Posted February 25, 2015 Report Posted February 25, 2015 The labview webbrowser stuff is pretty crappy. Use a .net webBrowser control, navigate, get the document and you can pretty much do what you want using standard .net calls, and really gives you better control over the browser (which is IE version on your machiene) At this point you can pretty much google how to get stuff, just look to use visual basic or C# and follow the .net calls putting them in labVIEW. Enjoy! Get Webpage Stuff.vi Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.