# MSXML: can't GET external sites



## morsagmon (May 27, 2007)

Hello.

The following is consistent in two separate machines (Win 2000 and Win XP), however, on the same network.

The following code works fine when I'm opening FILES located on my own machine (URL looks like this: http://<hostname>/<filename>.html).
When I'm opening the default (Microsoft IIS) page (URL looks like this: http://<hostname>) the text stream displayed in return includes a hint on authorizations:
---------------------------------------------------------
You are not authorized to view this page

<script>
function Homepage(){
<!--
// in real bits, urls get returned to our script like this:
// res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
------------------------------------------------------------

HOWEVER, there's no problem opening the default page directly through a browser (or any other URL, internal or external, for that matter).

Moreover, when I'm attempting an external site (e.g. google), I'm failing altogether to execute the ".send" command, and receive the 500.100 error:
----------------------------------------------------------
Error Type:
msxml3.dll (0x80072EE7)
The server name or address could not be resolved
/Mor/xmlhttp_sample.asp, line 24

-----------------------------------------------------------

My code:

XMLHTTP Example

<%
dim objXMLHTTP

set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")

objXMLHTTP.Open "GET", "http://www.google.com", false
objXMLHTTP.SetRequestHeader "Content-type", "text/html"
objXMLHTTP.Send
%>
<xmp>
<%=objXMLHTTP.ResponseText%>
</xmp>

--------------------------------------------------------

What am I doing wrong?

Thanks!
Mor


----------



## poornima.krishna (Oct 7, 2007)

Hi,

I am also trying to get the url contents of some external sites. It is not working.

Please somebody explain why or help me what I need to do..

Thanks and Regards,
Poornima.


----------

