HTTP.Open - Permission Denied error

F

fniles

In our ASP page, we call XMLHttp to download XML files. When calling our
page using localhost (localhost/myWebSite/myPage.htm), it works, but when
calling using the IP address of the web server
(xx.x.x.xxx/myWebSite/myPage.htm), I got "Permission denied" error in the
HTTP.Open statement.

Set http = CreateObject("Microsoft.XmlHttp")
http.open "Get", "http://" & "xx.x.x.xxx" & "/XMLFiles/N-1min.xml",
ALSE --> permission denied error

Why do I get permission denied error on the HTTP.Open, and how to fix it ?

Thanks.
 
A

Anthony Jones

fniles said:
In our ASP page, we call XMLHttp to download XML files. When calling our
page using localhost (localhost/myWebSite/myPage.htm), it works, but when
calling using the IP address of the web server
(xx.x.x.xxx/myWebSite/myPage.htm), I got "Permission denied" error in the
HTTP.Open statement.

Set http = CreateObject("Microsoft.XmlHttp")
http.open "Get", "http://" & "xx.x.x.xxx" & "/XMLFiles/N-1min.xml",
ALSE --> permission denied error

Why do I get permission denied error on the HTTP.Open, and how to fix it ?

Thanks.

Is the web server IIS?
Does it have more than one web site?
Are host headers set on the site you are accessing?
Does the site have anonymous access enabled?
Why do you want to hard code an IP address into your web page anyway?
Is the ASP Page running on the same server that you are trying to fetch
from?

BTW on a server you should use MSXML3.ServerXMLHTTP.3.0, XMLHttp is not
thread safe and should not be used with in ASP or COM+.

Anthony.
 
F

fniles

Is the web server IIS?
yes
Does it have more than one web site? yes
Are host headers set on the site you are accessing? What did you mean by this ?
Does the site have anonymous access enabled? yes
Why do you want to hard code an IP address into your web page anyway?
Did you mean to use the web server name instead of the IP address ?
Is the ASP Page running on the same server that you are trying to fetch
from?
The ASP page is on a different machine than the XML file
 
A

Anthony Jones

fniles said:
What did you mean by this ?

There are a few different ways that IIS can route requests to the
appropriate web site.

By default there is only one web site which will be listening on port 80 and
can be accessed via any IP address that addresses the server.

When you add a new website you can specify for example that the site is for
one of the IP addresses that the server has. The default web site will stop
responding to that address.

Another more common way is to specify a host header for the site. If you
have DNS entries Site1 and Site2 both pointing to the same server you can
specify which site responds depending on which name was used in the URL to
access the server.

So if you have a site that has the host header 'localhost' and a default web
site then using a straight IP address is likely to route to the default web
site than when you use localhost in the URL.
Did you mean to use the web server name instead of the IP address ?

Yes that would seem to more sensible.
The ASP page is on a different machine than the XML file

When you use localhost then it will be accessing your local machine not the
remote site.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,034
Messages
2,570,356
Members
47,002
Latest member
RobertoLip

Latest Threads

Top