digital_soul
asked on
How to handle timeout exceptions when using MSXML2.ServerXMLHTTP in ASP
Hi Experts
I have a server side ASP script that recieves an XML document that can include a batch of jobs ot process and then sends each single job to another asp script over Serverxmlhttp to process and awaits a response. Once all jobs in the xml have been processed the total response is then returned to the sender.
The problem I have is that whilst each job typically takes less than a second to process, sporadically Serverxmlhttp seems to hang for anything up to 30 seconds on a single request which then times out the whole process and the sender recieves no repsonse, even if all but the last job has been processed.
At this point I am accepting that the Serverxmlhttp object is going to sporadically do this and so need to add some way of handling instances where this happens.
What I would like to do is set a max timeout value of maybe 5 seconds for each job and if it takes longer than this for a response to be able to handle the timeout error, generate an appropriate response for that job record for the sender and move onto the next one.
How might I best do this?
Cheers
Stewart
I have a server side ASP script that recieves an XML document that can include a batch of jobs ot process and then sends each single job to another asp script over Serverxmlhttp to process and awaits a response. Once all jobs in the xml have been processed the total response is then returned to the sender.
The problem I have is that whilst each job typically takes less than a second to process, sporadically Serverxmlhttp seems to hang for anything up to 30 seconds on a single request which then times out the whole process and the sender recieves no repsonse, even if all but the last job has been processed.
At this point I am accepting that the Serverxmlhttp object is going to sporadically do this and so need to add some way of handling instances where this happens.
What I would like to do is set a max timeout value of maybe 5 seconds for each job and if it takes longer than this for a response to be able to handle the timeout error, generate an appropriate response for that job record for the sender and move onto the next one.
How might I best do this?
Cheers
Stewart
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.