Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Msxml2.ServerXMLHTTP and Time Out

Reply
Thread Tools

Msxml2.ServerXMLHTTP and Time Out

 
 
NeedHelp
Guest
Posts: n/a
 
      02-11-2010
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?
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      02-11-2010
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?


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
NeedHelp
Guest
Posts: n/a
 
      02-11-2010
On Feb 11, 3:43*pm, "Evertjan." <(E-Mail Removed)> wrote:
> 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?
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)


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?
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-11-2010
NeedHelp wrote on 11 feb 2010 in
microsoft.public.inetserver.asp.general:

> On Feb 11, 3:43*pm, "Evertjan." <(E-Mail Removed)> wrote:
>> 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?


[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)
 
Reply With Quote
 
NeedHelp
Guest
Posts: n/a
 
      02-11-2010
On Feb 11, 6:24*pm, "Evertjan." <(E-Mail Removed)> wrote:
> NeedHelp wrote on 11 feb 2010 in
> microsoft.public.inetserver.asp.general:
>
>
>
>
>
> > On Feb 11, 3:43*pm, "Evertjan." <(E-Mail Removed)> wrote:
> >> 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?

>
> [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.)
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-11-2010
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?]

> 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?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
NeedHelp
Guest
Posts: n/a
 
      02-12-2010
On Feb 11, 11:38*pm, "Evertjan." <(E-Mail Removed)>
wrote:
> 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?]
>
> > 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?
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)


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.
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-12-2010
NeedHelp wrote on 12 feb 2010 in
microsoft.public.inetserver.asp.general:

>> 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?


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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
Mark McGinty
Guest
Posts: n/a
 
      02-13-2010

"Evertjan." <(E-Mail Removed)> wrote in message
news:Xns9D1D69D9D03Aeejj99@194.109.133.242...
> 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.


>> 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.


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.
>
>> 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?


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


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


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


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-13-2010
Mark McGinty wrote on 13 feb 2010 in
microsoft.public.inetserver.asp.general:

>
> "Evertjan." <(E-Mail Removed)> wrote in message
> news:Xns9D1D69D9D03Aeejj99@194.109.133.242...
>> 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.

[..]

>>> (The asp code is running in my web site.)

>>
>> Where else can your ASP-code run?

>
> 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.

[..]

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

>
> [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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
Session time out/log out in .asp with windows authentication? J ASP General 2 05-05-2006 09:16 PM
Out of TIME! Out of LUCK! =?Utf-8?B?RGF2QVJlaQ==?= Windows 64bit 4 10-01-2005 02:17 AM
GMT time to local time, according to timezone and summer/winter time. David Joseph Bonnici Perl Misc 1 05-15-2005 09:15 PM
configure 'time out' time for urllib Andreas Dahl Python 2 02-26-2004 06:52 PM



Advertisments