06-25-2012 12:41 AM
I'm running LabVIEW Web Service with an application which follow the method shown in the weather monitor example. But my problem facing here is I need to keep click the refresh button then the Web Service only can update the latest data for me. So can anyone help me to show example on how to let the Web Service webpage automatically update the value without press the refresh button. Thank you
Solved! Go to Solution.
06-25-2012 02:24 AM
You need to do this at the client side since you cannot push things from server to client in HTTP, you (server) can only answer client requests.
Some possible solutions
I don't have experience with any of them.
06-25-2012 03:16 AM
Hi Biggeveen, i want to try on your second method but for the refresh header i don't know how to insert it. Is the refresh header put on the 'response string' there ?
06-25-2012 03:56 AM
First of all your client needs to support it. If you use the LabVIEW HTTP Client (GET.vi and so on) you cannot use this method. A normal browser should.
Take a look at FindContacts.vi from the Address Book example.
The help topic linked in the previous post should get you on the way as well. The infos are a bit scattered all over help file but it should be possible to understand it.
Basically there are two output options for a web service VI: Terminal mode as used in the Weather example and Stream mode as used in the Address Book example VI.
Use the Stream mode and construct the HTML page yourself, then send it to the browser with Write Response.vi. Somewhere in the top of the HTML page you need to insert
<meta http-equiv="refresh" content="5">
So you should return a string like
<HEAD> <TITLE>my title</TITLE> <META http-equiv="refresh" content="5"> </HEAD> <BODY> <P>If your browser supports Refresh, this page refreshes in 5 seconds.
And add some real contents here
</BODY>
See W3C as well.
Good luck
06-25-2012 04:02 AM
Thanks a lot Biggeveen. Is really help on me. Thank also of your links.