Re: Call Wait Loop?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I think the OP may be stuck with whatever has already been implemented
server-side.
As I understand it the first request fires off the process, second and
subsequent requests poll the server for process completion.
If not completed presumably the return message is "not done": if completed
then presumably it just grabs the result...

Tim


"Anthony Jones" <Ant@xxxxxxxxxxxxxxxx> wrote in message
news:%23yGLnSxwHHA.1168@xxxxxxxxxxxxxxxxxxxxxxx
"lucius" <lucius@xxxxxxxxxxxxxxxx> wrote in message
news:qp97935uk31hci5c8263dfdasoeildfend@xxxxxxxxxx

I don't have any code yet...

The first call does not expect any status or return. The second call
gets back a string (of XML) and it's up to the caller to determine
what is in it.

For sample purposes, I guess two functions "FirstCall()" and
"SecondCall()" would do me fine. I think the main thing I don't get is
how to structure my loops with setTimeout or whatever else I need to
do so the browser doesn't lock up completely. The code will eventually
run inside a much larger web page structure, so my stuff has to "play
nicely".

...ok, I just stated to write something but after 10 minutes I don't
have anything concrete.



Are you sure that this mechanism is necessary. The only advantage it has
over an asynchronous XML fetch is that it doesn't tie up a connection to
the
server. In the code below you need only on page that simply gets on with
whatever needs to be done and returns the results.

function getXMLAsync(sURL, fnResult)
{

var oXMLHttp

if (window.XMLHttpRequest)
oXMLHttp= new XMLHttpRequest()
else
oXMLHttp= new ActiveXObject("MSXML2.XMLHTTP.3.0")

oXMLHttp.open("GET", sURL, true)
oXMLHttp.onreadystatechange = fnRequestStateChange
oXMLHttp.send()

function fnRequestStateChange()
{
if (oXMLHttp.readyState == 4)
{
oXMLHttp.onreadystatechange = fnVoid
if (oXMLHttp.status == 200)
fnResult(oXMLHttp.responseXML)
else
fnResult(null)
}
}

}

function fnVoid() {}


var moXML = null;

function onResult(oXML)
{
moXML = oXML
if (moXML)
{
// Do stuff with XML
}
}


getXMLAsync("your url here", onResult)


The getXMLAsync returns imeadiately and control returns to the browser.
onResult fires when the request is complete.



--
Anthony Jones - MVP ASP/ASP.NET


Thanks.



On Mon, 9 Jul 2007 23:17:01 -0700, "Tim Williams" <timjwilliams at
gmail dot com> wrote:

Make the first request then set a timeout for the second call. If no
results, set the timeout again.

Exact details will depend on specific information: for example
- does the first request return any status information ?
- what is returned from the second call if the info is not yet ready?

If you show the code you have so far, I'm sure you'll get suggestions on
how
to adapt it.

Tim



"lucius" <lucius@xxxxxxxxxxxxxxxx> wrote in message
news:7c4693hcjar64341c0fos3jghha8kpmauv@xxxxxxxxxx

I have a webservice that is async, so it takes 2 calls to get data: 1
to request it and 1 to see if there are results. The caller is
expected to wait 4 seconds for it to finish and then make call #2, if
no response then wait 4 seconds again.

Can anyone show a clever combo of setTimeout or equivalent so I can
get that functionality in JavaScript ib IE6 and IE7? I don't want to
lock up the browser while I'm waiting/looping...


Thanks.






.



Relevant Pages

  • [REVS] NTLM HTTP Authentication is Insecure By Design
    ... in front of a web server, and that proxy server shares a single TCP ... These are attacks that make use of non-RFC HTTP requests (HTTP Request ... the authentication is associated with the ...
    (Securiteam)
  • [NT] 04WebServer Multiple Vulnerabilities (CSS, Log File Injection, AUX DoS)
    ... 04WebServer is a HTTP server developed by Soft3304 for Windows platforms. ... Characters into Log File ... filtering on the request URL before writing it into the log file. ... following HTTP request, when submitted to a vulnerable 04WebServer, will ...
    (Securiteam)
  • Re: breaking the model
    ... > The forms data then is in the Request object. ... HTTP Request; in this case, the form POST Request from the Page. ... client and server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Anonymous Anonymity - Request For Comments
    ... > and request that you reply directly to my e-mail address. ... > for the entity wishing to preserve their anonymity. ... > the machine can perform as a Intermediary Server and / or as a Intermediary ... > The software then attempts connection to a Intermediary Server. ...
    (Bugtraq)
  • Re: BASIC authentication Issues with IE - Part II - Solved but WHY?
    ... We have complete control of the Request and Response ... it is up to the browser to send the credentials. ... ASP runs internally on the server. ...
    (microsoft.public.inetserver.iis.security)