Msxml2.ServerXMLHTTP and Time Out

N

NeedHelp

Hi,

I am using following code in my asp file:

Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP")
xml.Open "GET", url, False
xml.Send
s = xml.responseText
Set xml = Nothing

Sometimes (not always), the asp file didn't work and returned Time
Out. Every time when it happend, I immediately clicked the refresh
button of my bowser and the asp file would work fine.

I think there must be something I am missing....Do you have any idea?
 
E

Evertjan.

NeedHelp wrote on 11 feb 2010 in microsoft.public.inetserver.asp.general:
Hi,

I am using following code in my asp file:

Set xml = Server.CreateObject("Msxml2.ServerXMLHTTP")
xml.Open "GET", url, False
xml.Send
s = xml.responseText
Set xml = Nothing

Sometimes (not always), the asp file didn't work and returned Time
Out. Every time when it happend, I immediately clicked the refresh
button of my bowser and the asp file would work fine.

I think there must be something I am missing....Do you have any idea?

It seems that the "url" was not responding quick enough now and then.

You could manipulate 4 different timeouts:
<http://msdn.microsoft.com/en-us/library/ms760403(VS.85).aspx>

Perhaps using onreadystatechange would help?
 
N

NeedHelp

NeedHelp wrote on 11 feb 2010 in microsoft.public.inetserver.asp.general:






It seems that the "url" was not responding quick enough now and then.

You could manipulate 4 different timeouts:
<http://msdn.microsoft.com/en-us/library/ms760403(VS.85).aspx>

Perhaps using onreadystatechange would help?

Thank you.
I don't want to set the timeout because I need the "url" responding as
fast as possible. It seems to me that after the timeout, I can get
responding quickly (immediately) by click the refresh button (run
the file second time), Why not responds quickly at the first time?
 
E

Evertjan.

NeedHelp wrote on 11 feb 2010 in
microsoft.public.inetserver.asp.general:

[please do not quote signatures on usenet]
Thank you.
I don't want to set the timeout because I need the "url" responding as
fast as possible.

Wrong idea.

A timeout gives the maximum time before an error is raised or a default
error action is done,

Such timeout does not slow down ther normal action.
It seems to me that after the timeout, I can get
responding quickly (immediately) by click the refresh button (run
the file second time), Why not responds quickly at the first time?

Because the url stream is only intermittently slow?
 
N

NeedHelp

NeedHelp wrote on 11 feb 2010 in
microsoft.public.inetserver.asp.general:





[please do not quote signatures on usenet]
Thank you.
I don't want to set the timeout because I need the "url" responding as
fast as possible.

Wrong idea.

A timeout gives the maximum time before an error is raised or a default
error action is done,

Such timeout does not slow down ther normal action.
It seems to me that after the timeout, I can get
responding  quickly (immediately)  by click the refresh button (run
the file second time), Why not responds quickly at the first time?

Because the url stream is only intermittently slow?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)- Hide quoted text -

- Show quoted text -

Thank you.

Yes, I believe you are right: A timeout gives the maximum time before
an error is raised or a default error action is done, And such timeout
does not slow down ther normal action.
However, setting timeout wont solve my problem. I want to find why
whenever timeout error happened and run the code again immediately,
the code can run with no time. If I find the reason, I might able to
set something or modify something and never let the timeout error
display on the users' browsers! (The asp code is running in my web
site.)
 
E

Evertjan.

NeedHelp wrote on 11 feb 2010 in microsoft.public.inetserver.asp.general:

[please do not quote signatures on usenet, that is "not done" on usenet.
Heh, I wrot that is thas last posting too.
Didn't you read that or don't you agree?]
Thank you.

Yes, I believe you are right: A timeout gives the maximum time before
an error is raised or a default error action is done, And such timeout
does not slow down ther normal action.
However, setting timeout wont solve my problem.

Why not?
I want to find why
whenever timeout error happened and run the code again immediately,
the code can run with no time.

I told you, the fetching of an external stream varies in time.
You cannot help the spead of that stream if that is due to the packet
stream of the Internet.

And it is always the first try that is slow, never the second, because if
the first is all right you do not try a second one.
The chance of twice slow being the square of a seldom event, so is far
more seldom.
If I find the reason,

Did you disprove my reasoning, or do you simply not read or like it?
I might able to set something or modify something and never let the
timeout error display on the users' browsers!

If you set the timeout long enoug, the error will become lmore seldom, if
my surmize is valid.

Even so, you can catch errors and deal with it as you like serverside.
(The asp code is running in my web site.)

Where else can your ASP-code run?
 
N

NeedHelp

NeedHelp wrote on 11 feb 2010 in microsoft.public.inetserver.asp.general:

[please do not quote signatures on usenet, that is "not done" on usenet.
Heh, I wrot that is thas last posting too.
Didn't you read that or don't you agree?]
Thank you.
Yes, I believe you are right: A timeout gives the maximum time before
an error is raised or a default error action is done, And such timeout
does not slow down ther normal action.
However, setting timeout wont solve my problem.

Why not?
I want to find why
whenever timeout error happened and run the code again immediately,
the code can run with no time.

I told you, the fetching of an external stream varies in time.
You cannot help the spead of that stream if that is due to the packet
stream of the Internet.

And it is always the first try that is slow, never the second, because if
the first is all right you do not try  a second one.
The chance of twice slow being the square of a seldom event, so is far
more seldom.
If I find the reason,

Did you disprove my reasoning, or do you simply not read or like it?
I might able to set something or modify something and never let the
timeout error display on the users' browsers!

If you set the timeout long enoug, the error will become lmore seldom, if
my surmize is valid.

Even so, you can catch errors and deal with it as you like serverside.
(The asp code is running in my web site.)

Where else can your ASP-code run?

I believe the page should finish all job in, say 1 second, even in a
very slow and busy server. There must be something I don't know.
 
E

Evertjan.

NeedHelp wrote on 12 feb 2010 in
microsoft.public.inetserver.asp.general:

WHY DO YOU KEEP QUOTING SIGNATURES?
I believe the page should finish all job in, say 1 second, even in a
very slow and busy server.

This is not about a statement of faith,
but about facts of life.

Fact of life is, that the internet is not always that fast,
so if your page fetches information from another url,
sometiimes that takes minutes, irrespectful if you believe it or not.

Either
you make the timout sufficiently large,
you handle the error in an convenient way,
you let things go wrong as they are,
or
you rebuild the internet to your believes.
There must be something I don't know.

That much I know.
 
M

Mark McGinty

Evertjan. said:
NeedHelp wrote on 11 feb 2010 in microsoft.public.inetserver.asp.general:

[please do not quote signatures on usenet, that is "not done" on usenet.
Heh, I wrot that is thas last posting too.
Didn't you read that or don't you agree?]

Isn't there a netiquite rule about being an overly-insistent demanding
little sniveler? There ought to be, but regardless, I must admit it wasn't
100% clear to me what you were on about, the first time I read it. But then
again you're always on about something, which makes your nit-picks easy for
me to ignore... So when you encounter non-compliance, and feel compelled to
poll for the reason, you should add "didn't understand" and "don't really
care" to the list of options.

Why not?


I told you, the fetching of an external stream varies in time.
You cannot help the spead of that stream if that is due to the packet
stream of the Internet.

Yes but the default timeout is 90 seconds. Unless the request is highly
processor-intensive, for it to take anywhere near that long is usually
indicative of at least some problem. Even if absolutely nothing else, very
few users will wait that long for a web page to load, which constitutes a
problem in-and-of itself.

And it is always the first try that is slow, never the second, because if
the first is all right you do not try a second one.
The chance of twice slow being the square of a seldom event, so is far
more seldom.


Did you disprove my reasoning, or do you simply not read or like it?


If you set the timeout long enoug, the error will become lmore seldom, if
my surmize is valid.

Even so, you can catch errors and deal with it as you like serverside.


Where else can your ASP-code run?

Well, I run ASP code on my workstation pretty often, but that's not
important. Since the original question involved ServerXMLHTTP, I'm going to
go out on a limb and assume the ASP code to which the OP referred, is that
being called by ServerXMLHTTP. (This assumption adds infinite relevance,
and subtracts that statement-of-the-obvious quality that apparently drew
your sarcasm, don't you think?)

To the OP, you are aware that calls to ServerXMLHTTP must not send requests
to the same virtual server on which the calling script is executing,
correct? IOW, the script http://www.myserver.com/xmlhttpcaller.asp must not
reference any other ASP script on www.myserver.com when calling XMLHTTP.
Doing so can deadlock the script engine.

Even calling an XML source on a different virtual but same physical server
can cause issues, depending on app pools, isolation settings, threading
models of COM objects being used, etc. So if this is all running on the
same server box, I strongly suspect some sort of deadlock is intermittently
occurring. Timeout (like any other error) terminates the request, which
frees-up whatever resource is in contention, paving the way for the next
request to succeed as normal.

A telling test would be, next time the page that calls XMLHTTP takes longer
than a few seconds to complete, open the same page in another browser. If
that one hangs too, you've almost certainly got a deadlock on your hands.
Another diagnostic approach might be to set the timeout for the ASP page
that renders the XML to something very short (like 2x or 3x max amount of
time it should ever take to complete.) Then code the caller to check
status/eat errors/etc and retry a few times upon failure. (By default both
the caller and callee will timeout almost silmultaneously, but it doesn't
have to be that way.) Note that I'm not suggesting this for production
code, only for diagnostics.


-Mark


[If you don't want it quoted back, don't append it to your posts.]
 
E

Evertjan.

Mark McGinty wrote on 13 feb 2010 in
microsoft.public.inetserver.asp.general:
Evertjan. said:
NeedHelp wrote on 11 feb 2010 in
microsoft.public.inetserver.asp.general:
Because the url stream is only intermittently slow?

[please do not quote signatures on usenet, that is "not done" on
usenet. Heh, I wrot that is thas last posting too.
Didn't you read that or don't you agree?]

Isn't there a netiquite rule about being an overly-insistent demanding
little sniveler? There ought to be, but regardless, I must admit it
wasn't 100% clear to me what you were on about, the first time I read
it. But then again you're always on about something, which makes your
nit-picks easy for me to ignore... So when you encounter
non-compliance, and feel compelled to poll for the reason, you should
add "didn't understand" and "don't really care" to the list of
options.

Ignoring my request to adhere to Netiquette urged met to be more insistent,
and it seems it worked as you feel insulted, which wasn't the intention but
could be a useful by-product.

[..]
Well, I run ASP code on my workstation pretty often,

You musst mean p.c.

You can only do that if you install a local server on your p.c.,
in the case of classic ASP IIS, and so having a virtual website.

"infinite relevance" ?
but that's not important.

This whole tread is not important. Should NG threads be important?
Since the original question involved ServerXMLHTTP, I'm
going to go out on a limb and assume the ASP code to which the OP
referred, is that being called by ServerXMLHTTP.
(This assumption
adds infinite relevance, and subtracts that statement-of-the-obvious
quality that apparently drew your sarcasm, don't you think?)

I don't. Why schould it substract?

The felt sarcasm is only your opinion, not my intention.

In discussion, showing obviousness is normal.

[..]
[If you don't want it quoted back, don't append it to your posts.]

What nonsene, so I should offend against Netiquette, by not using a proper
signature, because you don't want to abide to it?

Any good newsreader will automagically strip the signature, so using such
help you to abide.
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959

Not so your Outlook Express, it seems,
but then that is not a proper newsreader.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top