LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket HTTP Get Request Returns Error 42

Solved!
Go to solution

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: 

http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNjoDMACQA--&stre...

 

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 

 

 

 

 

0 Kudos
Message 1 of 3
(5,316 Views)
Solution
Accepted by howmean

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

Message 2 of 3
(5,207 Views)

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. 

0 Kudos
Message 3 of 3
(4,220 Views)