Posted on 2005-04-11
Last Modified: 2008-02-01
Hi experts,

I have some code which retrieves and xml string from a remote server. I have set the xmlServerHttp.setTimeouts method of the xmlHTTP object as below:

dim xmlServerHttp, objXML
Set xmlServerHttp = Server.CreateObject("Msxml2.ServerXmlHttp.3.0")

lResolve = 5 * 1000
lConnect = 5 * 1000
lSend = 15 * 1000
lReceive = 15 * 1000
xmlServerHttp.setTimeouts  lResolve, lConnect, lSend, lReceive

xmlServerHttp.Open "POST", heURLVal , False
xmlServerHttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
xmlServerHttp.Send strxml

responseString = xmlServerHttp.responsetext

if testMode then
Response.Write "<xmp>"
Response.Write "</xmp><br><br>"

As I understand it if any of the xmlServerHttp.setTimeouts properties times out then the error returned will be a script timed out error.

What I need to know is how do I trap this error, deal with it, and make sure that it doesn't break my ASP page at runtime?

Any ideas?


Question by:pjordanna
    1 Comment
    LVL 15

    Accepted Solution

    > As I understand it if any of the xmlServerHttp.setTimeouts properties
    > times out then the error returned will be a script timed out error.

    This is not correct. If any of the timeouts specified by the SetTimeouts method are met then the HTTP connection established (or attempting to be established) by XMLHTTP is terminated. This has nothing to do with the script timeout of your ASP page.

    You can check the Status property of XMLHTTP to see what's happening with your HTTP connection and proceed accordingly.

    So set the timeouts, call Send() then check the status property to see what's happening.

    See here for more info:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now