GetWebPage Question (OpenInsight 32-bit)
At 02 JUL 2012 06:33:02PM Ray Chan wrote:
We've recently started playing with GetWebPage and it works. We can go out with it and pull back some info.
However, in testing this (for no internet connection), if you're NOT connected to the Internet then GetWebPage will return nothing as expected.
If nothing is returned, we trap this event by setting some default values and continue with our process, However, in this situation, the process will NOT fully continue. Under runtime, you may see a message "Another process has exclusive access to the engine or the debugger has suspended…."
However, if in the process of trapping this event, we ADD a MSG statement then our process will continue as it should (normal, no exception, no beeping, etc.)
For the present we have added a MSG (that will not display – first time to use such a thing) and everything works just fine.
I'm just curious why when using the GETWEBPAGE and you're not connected to the internet, our process will hang unless we put in a Message statement. What is the Message statement doing that allow our process to continue? And why is this necessary when you're using GetWebPage and the internet connection doesn't exist?
Thanks!
Ray Chan
OI 8.0.8, Windows 7 32 and 64, XP Professional
At 10 JUL 2012 10:46AM bob carten wrote:
Hi Ray,
Msg may be calling set_Status(0). Try adding your own call to Set_Status(0). Also, try using OLE_GETWEBPAGE instead of GETWEBPAGE.
- Bob
At 10 JUL 2012 02:32PM Ray Chan wrote:
Hi Bob,
Thanks for the reply!
First, we're using OI 808. Do you think that OLE_GetWebPage is available in this version? I don't see it in any documentation that I have.
Second, do you think that the GetWebPage behavior (no connection to internet) is what should be expected or do you think this is an OI bug?
I can try the Set_Status(0) and see what happens and if this can used in place of the suppressed Msg.
Ray
At 12 JUL 2012 06:28PM Carl Pates wrote:
Hi Ray,
Hope life is well with you :)
OLE_GetWebPage() should be in OI 8.0.8 (I had to use it in a 8.0.8 system today in fact). You are much better off using this in preference to the old GetWebPage() - it is a much more comprehensive solution as it uses part of the MS XML framework.
With regards to the "hanging" problem - it might be down to a timeout and I suspect that it's using a blocking socket so your thread gets locked while waiting. It *might* be that using the Msg() call allows the UI thread to process it's message queue but without looking at the code in question it's hard to say.
Anyway, I'd use OLE_GetWebPage() in preference to GetWebPage() as Bob suggested.
Cheers
World leaders in all things RevSoft
At 12 JUL 2012 07:45PM Ray Chan wrote:
Hi Carl,
Well things could be better. Had to replace a server here. As with most things with computers, it took longer than expected. Basically we're just completing the install and the network here looks like it's working. I think we can probably give OLE_GetWebPage a "shot" tomorrow sometime and see how it goes. Right now, I think we need to relax and grab a brew and some chow.
Well I appreciate your offering an explanation because I was really curious as to why if we incorporate a MSG in our logic then the process will continue. It seemed odd to me and unnecessary to avoid a "hang". Truth be told, however, after banging our head on something like this and finding a "possible" workaround we're so happy that we'll bless it and say "so be it." It's good to go and then look for the next project.
Hope all is well with you you too. If you're going to the Opening Ceremony for the Olympic, don't forget to "wave". I'll be watching for it on TV here.
From the "Greenest State in the land of the Free",
Ray
At 26 JUL 2012 02:41PM ray chan wrote:
The set_status(0) call worked successfully. If we call set_status(0), we don't have to call a message anymore.
We compared OLE_GetWebPage to GetWebPage and noticed that OLE_GetWebPage appeared to return the exact source of a web page, while GetWebPage returns various header information. We've been using GetWebPage to read a web site and then extracted the current time from the header. Do you have any additional information about what exactly GetWebPage is supposed to return? OLE_GetWebPage is definitely a better function for reading web sites, when we are interested in the exact contents of the page.
Thanks,
Ray Chan
At 26 JUL 2012 02:50PM bob carten wrote:
The syntax is:
result = Ole_GetWebpage(url, method, payload, credentials, headers)
In recent versions of OI OLEGETWEBPAGE will populate headers with the headers returned from the server.