04-01-2009 04:42 AM
Hi,
I am currently using "DataSocket Read" function to make HTTP Request.
The aim of my application is actually to do a HTTP Get Request from a particular website.
For eg:
This request fails and the error code return is "Error 42".
However, I have no problem making a HTTP request to other sites.
For eg:
http://www.google.com.sg/search?hl=en&q=datasocket+read+error+42&btnG=Search&meta=&aq=f&oq=
May I know what is the possible reason for this failure to occur?
Thanks,
How Mean
Solved! Go to Solution.
04-15-2009 05:18 AM
Hi How Mean,
I was handling a support request and chanced upon this thread when I was searching for information, not sure if you still need help since it's been a while, but here's the VI you can use.
The problem from Datasocket arose because the page you are trying to read from is actually a Web Service which returns the information in XML format. You need to append [text] to the end of the URL to make Datasocket return the information as unformatted text. Please refer to this KB for more information on this: Retrieving an Unformatted Text File via FTP or HTTP Using DataSocket
After this it's basically string manipulations to pick out the latitude and longitude information from the returned text information.
Hope this helps.
Best Regards,
Boon Chen
NI ASEAN Applications Engineer
04-19-2013 01:09 PM
Having a similar problem with a weather API. My attempts to append [text] as well as running the GetLocationXml.vi that was attached all fail at the Datasocket read with error 42.