Hi.
I'm experimenting with the Automation class 'Microsoft WinHTTP Services, version 5.1'.WinHttpRequest'. It looks to me like I can use this to reach out and grab web content.
So far though, I haven't come up with much. The following code is my 'hacking-to-date':
Vars:
WinHTTPRequest
Type: Automation
Automation server: Microsoft WinHTTP Services, version 5.1
Class: WinHttpRequest
RText
Type: BigText
CREATE(WinHTTPRequest);
WinHTTPRequest.Open('GET','http://www.mibuso.com',FALSE);
WinHTTPRequest.Send;
IF WinHTTPRequest.
WaitForResponse(5000) THEN BEGIN
CLEAR(RText);
RText.ADDTEXT(WinHTTPRequest.ResponseBody());
MESSAGE(FORMAT(RText));
END ELSE
MESSAGE('No Response');
When I run this, I get three odd characters in the MESSAGE window.
If I change the code to use a plain Text variable to store the respone in, I get the error "This data type is not supported by C/Side."
I'm having fun - but not getting very far.
Has anyone used this automation server (and can maybe point out where I'm being a total idiot), or know of any working examples anywhere?
Thanks in advance.
Bob
Comments
What is it you are trying to achieve with WinHTTP, download content? Check -> Download content with NAV.
Rvduuren
Thank's for that link - that look exactly like what I'm after.
The background is I want to download currency echange rate information from a given URL. I started a thread about this earlier and reciived an excellent link to the download section for an XML-based solution.
I'll probably go with this idea though - it's simpler and required fewer objects.
Bob
So with this little example you can download a XML file from a specific url and import this file with a XMLPort (also you can use the XMLDom)
Regards
This is all great stuff people - thanks!
I was just reading the article at the link below the previous post here came in. This looks really good:
http://blogs.msdn.com/nav_developer/archive/2008/03/31/sample-of-how-to-read-a-simple-xml-document-using-msxml-dom-in-nav.aspx
Bob