Forum Moderators: open

Message Too Old, No Replies

MSXML2.XMLHTTP.4.0 --> Open "access denied"

Does not work when I upload the page to my web server

         

aries

11:36 am on Jun 15, 2004 (gmt 0)

10+ Year Member



Hello there,

I am using MSXML2.XMLHTTP.4.0 to retrieve data from an eternal web page (other domain) and displaying the contents in my local web page. This works perfectly when I run it from my local system. When I upload it to my Web Server and access it, then it does not work. The following is the code:

var objSrvHTTP;
objSrvHTTP = new ActiveXObject("Msxml2.XMLHTTP.4.0");
objSrvHTTP.open ("GET",theURL,false);

I am getting the "access denied" error exactly at the third line where the URL is passed. Can anyone help me with this?

Also, please let me know if there are any other methods to retrieve the data without using Msxml2.XMLHTTP.4.0.

Thank you!
aries

Bernard Marx

12:02 pm on Jun 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can't use that object to access data from outside your domain.
The exception to this is when you are running the page locally. Some sources suggest otherwise, but it works fine for me.

Perhaps it is possible to instantiate the object on the server within ASP. Maybe it can work that way.

aries

12:13 pm on Jun 15, 2004 (gmt 0)

10+ Year Member



"Instantiate the Object"?

Can you expain this part? Do I have to contact my Web hosting customer service for help on this?

Also, do you mean to say that if I convert the same code to ASP it will work? Please explain. :)

Thank you!
aries

Bernard Marx

1:12 pm on Jun 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just mean: "create the object server-side"

I could have a stab at it using ASP with JScript, but your best bet would be to head off to the ASP forum [webmasterworld.com ] to find out if it's possible, and if so, how it's done.

Good luck

aries

6:09 am on Jun 16, 2004 (gmt 0)

10+ Year Member



Bernard,

"I could have a stab at it using ASP with JScript."

Can you provide me the code that you have developed, if it is working for you on your web server?

Thank you!
aries

Bernard Marx

11:37 am on Jun 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



"It works for me" - locally, that is. I'd previously never tried this kind of thing server-side. After a quick fiddle, I've decided that I have absolutely no idea what I'm doing. I'm 99% certain it is possible, but how? Perhaps it requires .net .