Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Nov : TWebBrowser - XML Response

www.cryer.info
Managed Newsgroup Archive

TWebBrowser - XML Response

Subject:TWebBrowser - XML Response
Posted by:"Dale Francis" (dfranc..@mortgagesoftware.to)
Date:Fri, 18 Nov 2005 08:54:17

Hello,

I have 2 scenarios that attempt to use TWebBrowser to get a response from a
site.  One scenario works... the other doesn't come close.

The scenario that works is straightforward.  First, I post data and open a
website in a Delphi browser using TWebBrowser.Navigate.  Then, from this
website I export an XML response file which is captured by my TWebBrowser's
OnDocumentComplete event.  I simply display the XML response in my Delphi
brower window.

The scenario that doesn't work is more confusing (to me).  In this scenario
I also post data and expect an XML response file in return.  But I don't
actually need to open the site that I am posting to and I don't explicitly
perform an "export file" function from the site.  Things are supposed to
work like this:

    1 - I post data to the site without actually displaying the site (using
TWebBrowser.Navigate?)
    2 - The site automatically sends back a response file
    3 - I capture the response (how? using OnDocumentComplete?) and either
process the response or perhaps display the XML in my browser

So, to recap, the actual site I post to ("navigate" to) is never displayed
in the browser.  The XML response file could be displayed in the browser or
handled otherwise.  (I don't care which.)

Here are the problems I am having trying to use the first scenario's
approach to achieve the second scenario:  The OnDocumentComplete event fires
when I issue TWebBrowser.Navigate, but no web page or document is returned.
(The browser displays an error.)  If the site does send back a response
file - and I don't know if it does - then it is not being captured in the
OnDocumentComplete event.

Random thoughts:  If I can't use TWebBrowser, I suppose I could try to use
Indy or I could upgrade to Delphi 7 or later (vs. D5) and try to use .NET.
But shouldn't TWebBrowser handle the task at hand?

Ideas?  Thanks.

Dale F.

Replies:

www.cryer.info
Managed Newsgroup Archive