Msxml2.ServerXMLHTTP and Time Out

Discussion in 'ASP General' started by NeedHelp, Feb 11, 2010.

  1. NeedHelp

    NeedHelp Guest

    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?
     
    NeedHelp, Feb 11, 2010
    #1
    1. Advertising

  2. NeedHelp

    Evertjan. Guest

    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)
     
    Evertjan., Feb 11, 2010
    #2
    1. Advertising

  3. NeedHelp

    NeedHelp Guest

    On Feb 11, 3:43 pm, "Evertjan." <> 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?
     
    NeedHelp, Feb 11, 2010
    #3
  4. NeedHelp

    Evertjan. Guest

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

    > On Feb 11, 3:43 pm, "Evertjan." <> 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)
     
    Evertjan., Feb 11, 2010
    #4
  5. NeedHelp

    NeedHelp Guest

    On Feb 11, 6:24 pm, "Evertjan." <> wrote:
    > NeedHelp wrote on 11 feb 2010 in
    > microsoft.public.inetserver.asp.general:
    >
    >
    >
    >
    >
    > > On Feb 11, 3:43 pm, "Evertjan." <> 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.)
     
    NeedHelp, Feb 11, 2010
    #5
  6. NeedHelp

    Evertjan. Guest

    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)
     
    Evertjan., Feb 11, 2010
    #6
  7. NeedHelp

    NeedHelp Guest

    On Feb 11, 11:38 pm, "Evertjan." <>
    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.
     
    NeedHelp, Feb 12, 2010
    #7
  8. NeedHelp

    Evertjan. Guest

    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)
     
    Evertjan., Feb 12, 2010
    #8
  9. NeedHelp

    Mark McGinty Guest

    "Evertjan." <> 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.]
     
    Mark McGinty, Feb 13, 2010
    #9
  10. NeedHelp

    Evertjan. Guest

    Mark McGinty wrote on 13 feb 2010 in
    microsoft.public.inetserver.asp.general:

    >
    > "Evertjan." <> 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)
     
    Evertjan., Feb 13, 2010
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Maris Janis Vasilevskis

    MSXML2.ServerXMLHTTP to HttpWebRequest: Error 500

    Maris Janis Vasilevskis, Aug 29, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    6,341
    Maris Janis Vasilevskis
    Aug 29, 2005
  2. bo0oost

    Msxml2.ServerXMLHTTP

    bo0oost, Apr 17, 2004, in forum: XML
    Replies:
    0
    Views:
    2,813
    bo0oost
    Apr 17, 2004
  3. MSXML2.ServerXMLHTTP

    , Aug 23, 2005, in forum: ASP .Net Web Services
    Replies:
    7
    Views:
    790
    dado49
    Aug 25, 2005
  4. Dick Berthold

    MSXML2.ServerXMLHTTP

    Dick Berthold, Jun 5, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    177
    Dick Berthold
    Jun 5, 2006
  5. katrinaVictim@.

    msxml2.serverXMLhttp and response.binarywrite

    katrinaVictim@., Oct 16, 2005, in forum: ASP General
    Replies:
    4
    Views:
    325
    McKirahan
    Oct 17, 2005
Loading...

Share This Page