Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: How to emulate clicking Edit, Select All, CTRL-C in InterNet Explorer? >Thread Next - Re: How to emulate clicking Edit, Select All, CTRL-C in InterNet Explorer? Re: How to emulate clicking Edit, Select All, CTRL-C in InterNet Explorer?To: NULL Date: 10/4/2005 2:52:00 PM
MLH wrote:
> OK, maybe I should have asked it this way, using VBA's CreateObject
> function, I utilize the following code snippet to launch a brief
> Microsoft XML HTTP session. With the URL shown, there is
> no problem capturing the webpage source (eBay's time server).
> On the other hand, I cannot say the same for this site:
> http://tycho.usno.navy.mil/cgi-bin/anim
> Can someone explain to me why the navy site causes my Access
> application to lock up tighter than a nun's ass?
> Set msXML = CreateObject("Microsoft.XMLHTTP")
> MyURL =
> "http://cgi1.eXXXbay.com/aw-cgi/eXXXBayISAPI.dll?TimeShow&hc=1&hm=td.s5ddl7437"
> ' The REAL URL does not contain any "XXX" string snippets. Remove them
> ' to get the REAL URL. Cannot post eBay in a URL string on this forum.
> ' Sorry.
> msXML.Open "GET", MyURL, False
You are using a synchronous request (third argument to open is False)
that will block the script after the send method until the complete
response has been received.
And that URL takes a long time to complete its response as it uses some
kind of server push method to send a multipart/x-mixed-replace response
where a browser is then supposed to render any part of the response,
then receive the next part and replace the previous part with that.
So a response from that URL starts like this
Date: Tue, 04 Oct 2005 12:32:21 GMT
Server: Apache/2.0.48 HP-UX_Apache-based_Web_Server (Unix) DAV/2 PHP/4.3.4
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: multipart/x-mixed-replace;boundary=---ThisRandomString---
---ThisRandomString---
Content-type: text/html
<CENTER><table border=2 ALIGN=CENTER VALIGN=CENTER CELLPADDING=3>
<TR><TH>US NAVAL OBSERVATORY MASTER CLOCK</TH><TH>Ticks Left</TH><TR><TD
ALIGN=CENTER >
<H2> Tue Oct 4 12:32:22 2005
UTC</H2></TD><TD ALIGN=CENTER><H3>31</H3></TD>
</TABLE></CENTER><P>
<A HREF="http://tycho.usno.navy.mil/what.html"> <B>STOP!</B></A>
---ThisRandomString---
Content-type: text/html
<CENTER><table border=2 ALIGN=CENTER VALIGN=CENTER CELLPADDING=3>
<TR><TH>US NAVAL OBSERVATORY MASTER CLOCK</TH><TH>Ticks Left</TH><TR><TD
ALIGN=CENTER >
<H2> Tue Oct 4 12:32:23 2005
UTC</H2></TD><TD ALIGN=CENTER><H3>30</H3></TD>
</TABLE></CENTER><P>
<A HREF="http://tycho.usno.navy.mil/what.html"> <B>STOP!</B></A>
---ThisRandomString---
and continues to push such parts every second for a rather long time.
If you really want to use MSXML to get the complete responseText of such
a response and not have MSXML lock up your script or its application
then you need to do asynchronous loading (third parameter to open is
True) and use an onreadystatechange event handler which waits for a
change of readyState to 4 and then accesses the responseText.
Documentation is here:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/63409298-0516-437d-b5af-68368157eae3.asp>
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/ab1b76cf-7dd9-46b5-b782-cc04823df117.asp>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
