我怎么火在ASP经典的异步调用,并忽略回应? [英] How do I fire an asynchronous call in asp classic and ignore the response?
问题描述
这里的要点是:
我有一个电话我想在ASP做的,我不关心的响应。我只是想火的电话,我不想让页面等待回应。根据该文件,它应该是这个样子:
I have a call I want to make in asp, and I do not care about the response. I just want to fire the call and I do not want the page to wait for the response. According to the documentation, it should look something like this:
dim xmlhttp : set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, true '' setting the 'asynchronous' option to 'true'
xmlhttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
xmlhttp.setRequestHeader "Content-Length", Len(XMLData)
xmlhttp.send XMLData
此同步调用时桃色的作品,但是当我翻转ansynchronous选项设置为真,没有火灾。我可以从互联网上收集的用户做一些这样的:
This works peachy when calling synchronously, but when I flip the ansynchronous option to 'true', nothing fires. What I can gather from the internet is that users do something like the following:
While xmlhttp.readyState <> 4
xmlhttp.waitForResponse 1000
Wend
我疯了在这并不是真的看起来像一个asynchrous电话了,但如果你正在等待回应?
Am I crazy in that this does not really seem like an asynchrous call anymore though if you are waiting for a response?
把行 xmlhttp.waitForResponse 1
发送后立即会引起火灾的要求,但同样,我不想等到第二。
putting the line xmlhttp.waitForResponse 1
right after the send will cause the request to fire, but again, I don't want to wait a second.
有什么想法?
推荐答案
今天,我得到了同样的问题。
我用Microsoft.XMLHTTP对象解决了。
Today I got the same issue. I resolved it by using "Microsoft.XMLHTTP" object.
dim xmlhttp
set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "POST", url, true
xmlhttp.Send ""
和现在的要求是同步发送和目标地址被击中。
希望有所帮助。
And now the request is sent asynchronously and target URL was hit. Hope that helps.
这篇关于我怎么火在ASP经典的异步调用,并忽略回应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!