当我使用 iis7.5 时,经典 ASP 中的 ServerXMLHTTP.send 出现错误
我有运行 iis7.5 的共享主机。
我想运行这段代码,它允许我显示另一个网址的内容。
<%
url = "abc.com"
Response.Write(url)
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>
该代码在 IIS6 上完美运行,但是当我迁移到 IIS7 时,它在“ xmlhttp.send "" ”行上给出了 操作超时
错误。这意味着无法建立连接。
我是否需要在 web.config 中进行一些更改才能运行此代码,或者是否有任何替代代码。
感谢您的帮助。
I have shared hosting which runs iis7.5 .
I wanted to run this code which allows me to display the content of the another url.
<%
url = "abc.com"
Response.Write(url)
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
Response.write xmlhttp.responseText
set xmlhttp = nothing
%>
This code was running perfectly on IIS6, but when I migrate to IIS7 it was giving me error of operation timed out
on ' xmlhttp.send "" ' line. It means its unable to establish connection.
Do I need to do some changes in web.config to run this code or Is there any alternative code.
Thanks for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有同样的问题。
MSXML2.ServerXMLHTTP
似乎在连接到其自己的站点时遇到问题。我通过创建一个具有相同目录但具有不同端口的新“站点”解决了这个问题。当我使用不同的端口
HTTP://SERVER:PORT/same/path/to/script.asp
调用MSXML2.ServerXMLHTTP
时,它工作正常。Had the same issue. It seems
MSXML2.ServerXMLHTTP
is having problems connecting to it's own site.I solved this problem by creating a new "site" with the same directory but with a different port. When I call
MSXML2.ServerXMLHTTP
with the different portHTTP://SERVER:PORT/same/path/to/script.asp
it works fine.除了您缺少 URL 中的
http://
之外,该脚本在我们的一台 Windows 2008R2/IIS7.5 服务器上运行得很好。我会检查您的托管服务商是否已阻止服务器(Windows 防火墙或 IPSec)上或其共享托管 LAN 内的出站端口 80 连接。
Apart from the fact that you're missing the
http://
from the url that script works just fine on one of our Windows 2008R2/IIS7.5 servers.I would check to see if your hoster has blocked outbound port 80 connections either on the server (Windows Firewall or IPSec), or within their shared hosting LAN.
尝试添加 MSXML2.serverXMLHTTP.6.0 或 MSXML2.serverXMLHTTP.4.0,具体取决于系统中安装的 MSXL 版本。
Try adding MSXML2.serverXMLHTTP.6.0 or MSXML2.serverXMLHTTP.4.0 depends the version of MSXL installed in your system.