Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem reading data from internet 1

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
AU
I am having problems reading data from a URL.
This data is details and GPS locations of a number of vehicles (Buses)
I can read it with Firefox opening with Notepad and see it is binary with some printable text.
If I open with Internet Transfer or Webbrowser I get a blank screen
If I open with IExplorer (ver 6 in my XP machine) I get the "Cant open" notice.

Is there a way to open it with Winsock and read to a stream in Vb6, erasing the stream as I read each vehicle? What port would I use?

Do I have to send it some code once connected to start it downloading?

This is the URL: This is the sender's description "The feed is an actual continuous stream which is in Protocol Buffer (Googles simplified XML platform) and has to be queried continuously"

I would have no trouble decoding and handling the data in vb6 once I could receive it.

I am not very familiar with HTML so any help would be appreciated.
 
That's weird. Posted itself ...

OK, that should fix the IE "cannot download error", but probably won't deal with the secure channel support issue. I suppose it might be feasible to try and ignore SSL errors:

Code:
[blue]Function GetDataFromURL(strURL As String) As Byte()
    With New WinHttpRequest
        .Open "GET", strURL
        [b][COLOR=#EF2929].Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300[/color][/b]
        .Send
        GetDataFromURL = .ResponseBody 
    End With
End Function[/blue]
 
>Honest, time to ditch XP!

The secure channel error might well be as a result of this - except it works fine on my XP laptop ...
 
I can't ditch XP for this installation. There are so many computers involved and they will opnlyt be replaced as they fail with old age.
Besides Firefox on an XP machine downloads the file to disk without the slightest problem so I doubt whether XP is the problem. You can't install anything later then IE6 on XP anyway according to Ms.
I'm experimenting further.
 
Trying the examples you have kindly posted I get "No reference" messages when trying XMLHTTP60 or ServerXMLHTTP60.
When trying the last one I get a message to say message was badly formatted on the .SEND line.
 
I see my Firefox is set to 'use system proxy'.
I can use Firefos to download the file in question whether proxy is set or not.
As there are Inet proxy settings, maybe I need to set it to a proxy to get Inet to work?
Problem is then how do I find out what proxy address to use as Firefox doesn't tell you what they use?
 
>You can't install anything later then IE6 on XP anyway according to Ms.

You most certainly can. Don't know where you got that info. IE8 happily runs on XP. Here it is, direct from Microsoft. BTW, is it safe to assume that your XP boxes are running Service Pack 3?

>without the slightest problem so I doubt whether XP is the problem

Firefox, being multiplatform, uses its own crypto and certificate libraries rather than using XPs. Unlike IE (and the other user agents I suggested)

>I get "No reference" messages when trying XMLHTTP60 or ServerXMLHTTP60.

Ok, note that my instruction was:
"Add a reference to Microsoft XML library (latest version on your XP machine should be 6)"

The "60" in the references relates to the version number of the library you are using. So if the latest XML library you have available is 4, then the references would be XMLHTTP40 and ServerXMLHTTP40.

Mind you, this suggests one other possibility - a 'simple' mismatch in (default) security protocols between XP and the server. Later versions of IE change the default protocols in use (which may explain why IE8 - and winHHTP and XMLHTTP - on my XP SP3 box works fine with the site). So we'll try forcing a specific protocol:

Code:
[blue]Function GetDataFromURL(strURL As String) As Byte()
    With New WinHttpRequest
        .Open "GET", strURL
        [COLOR=#EF2929][bold].Option(WinHttpRequestOption_SecureProtocols) = SecureProtocol_TLS1[/bold][/color]
        .Send 
        GetDataFromURL = .ResponseBody  
    End With
End Function[/blue]



 
No actually I am running service pack 2.
I remember trying to install it some time ago but it wouldn't install at that time. I think I got it from some dodgy third party site trying to see you some other junk software that was rejected by my virus detector because it contained malware.
I'll try it again.
 
Panic over!
Strongm's first simple version works now I have installed XP Service Pack 3
Thanks once again for all your trouble.
Hopefully it will continue to work and there is not some other bug.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top