11-16-2009 04:36 AM
Hi
i am trying to request a service from a website but i dont know which VI i should use.
I have to request the data in the address of the site itself and i am expexting data in the xml format.
How should i proceed with it?
11-16-2009 06:16 AM - edited 11-16-2009 06:18 AM
If the service you describe is a web service, then you can use the Import Web Service function in LabVIEW to read the data and view it as a LabVIEW data type (cluster, array, etc...)
If it is NOT a standard web service, the quickest solution would probably be to use the DataSocket protocol to retrieve the data. You would need to parse the XML yourself...
11-16-2009 09:54 AM
It might be as easy as reading the website's page? In the data, the address is echoed, and you can parse out the information you need? Just a guess. The attached VI will read a web page.
11-16-2009 02:06 PM
Here is another possible soultion
http://zone.ni.com/devzone/cda/epd/p/id/2743.
It has code to get the HTML code from a URL.
Once you have this, all you need to do is parse this code (String) for the data of interest
11-16-2009 09:39 PM
Thanks all for the reply.
This is the site from which i am trying to get the data. The input is in the form of an application id and address and in return i am going to get the coordinates (latitude & longitude) of the place.
There are many of toolkits in labVIEW for accessing internet. But i dont know from where should i start
12-05-2009 02:30 PM
The solution suggested by Broken Arrow seems to be perfect for you.
You can use the same one for your application.
12-05-2009 04:04 PM
I got it working with the example from the Yahoo web page. LV Version 2009f2.
1. The solution by BrokenArrow gives error 42 from the DataSocket Read.
2. The solution from the NI site is working with a little change. You have to set the property of IHTMLElement to OuterText. You will get the XML in the indiactor HTML Source Code.
Once you have the XML you can either parse the string by yourself or use the JKI EasyXML toolkit.
12-07-2009 08:47 AM
Thanks all for your contribution towards the thread.
I got the solution from the NI itself.
There is an example at this link