WINHTTP or MSINET

Biga Cubensis

New Member
Hello,

I'm developing a Progress application that sends and gets files from a HTTPS site. I tried some shareware products with not too big success and my friend told me that free APIs are exist: winhttp5.dll or msinet.ocx. I tried msinet but it does not work with HTTPS for me. Winhttp5.dll altough MS does not support anymore, seems support better the HTTPS and SSL.

I would try winhttp.dll but I don't know how to get function names and parameters under Progress. The Progress COM Viewer listed the functions, events etc but how I can use them? OCX is simple but how I can access to DLL functions and variables?

please help,
Gabor
 

Biga Cubensis

New Member
I tried download a binary file with winhttps. I found some example code using AODB for storing large binary files. There is my code:


def var winhttp as com-handle.
def var ostream as com-handle.

create "WinHTTP.WinHTTPRequest.5" winhttp.
create "ADODB.Stream" ostream.

ostream:type=1.
ostream:eek:pen.

winhttp:eek:pen("GET","http:/www.mysite/com/test.zip",0).
winhttp:send.

ostream:write(winhttp:ResponseBody).
ostream:savetofile("c:\!\test.zip",2).
ostream:close.

Progress lists a lot of errors: wrong parameters for open (ADODB), Parameter incorrect by ResponseBody, etc. altough the I got the syntax from VB examples. What is wrong?

thanks
 

Biga Cubensis

New Member
Hello,

this is not a DLL but an Automation object works like an ActiveX OCX. You can use it with CREATE "automation" com-handle command, for example you can access to a MsWord application with this method. WinHttp or ADODB is can be used as an automation object, it means I don't need function declarations but after the "registering" com-handle, I can access all methods and parameters.

Perhaps Progress can't handle certain properties what VB can. For example, the VB program use the Open method of ADODB.Stream without any parameters but Progress requires five. I don't understand why. Then I try copy winhttp's ResponseBody binary data to ADODB binary stream which can be saved as a file.

Acessing of ResponseBody is important because I use >32K files and these are mainly ZIP file, I can't use ResponseText.

The ResponseBody shows an Any-Type parameter and Progress COM Viewer suggests it is a safearray of UI1. I suppose it is an unsigned int array for storing binary data, but I have no idea how I can substitute it in Progress.

Why I not use OCX instead of automation. Because OCX based solutions do not work in ChUI and I'm using character interface.

cheers
Gabor
 
Top