I have several requests for a website that take a long time to start due to the data model and the amount of data stored in the tables. So far, I have run them manually against the database in order to avoid any timeout problems, etc. However, the site owner asked them to make available on the site so that he could get the results of the request.
I thought about it through the .NET web service and the classic ASP page called it asynchronously. A web page simply initiates the process before redirecting the user to another screen. The web service then launches the request and sends the results to the user in the CSV.
However, I cannot get this to work. The service works fine if I call it through a screen in IE, but calling it through an Ajax call in ASP seems to be a problem - no error is generated, but a CSV file is not generated either.
I have included the classic ASP code below. A service has only one method with an email name parameter that has a type string. Can anyone see something wrong with this? Also, is this the best way to do this, or should I think of a different approach?
Thanks in advance,
Phil
CODE
<%
message = "http://wwww.example.com/service/query.asmx/GetResults?email=test"
set req = server.createobject("MSXML2.XMLHTTP")
With req
.open "GET", message, False
.setRequestHeader "Content-Type", "text/xml"
.send
End With
works = req.responseText
response.redirect "http://www.bbc.co.uk"
%>
Phil
source
share