Solved

Can't stop permission denied errors from Microsoft.XMLHTTP on live page

Posted on 2001-07-18
7
1,214 Views
Last Modified: 2008-03-10
Hi,

I have some code in a page that will work great as a local file
but once I upload it to my server it generates "permission denied"
errors.

The relavent flawed code:

<script language="VBScript" type="text/vbscript">
Set xmlHTTP = CreateObject("Microsoft.XMLHTTP")
varDummy = xmlHttp.open("GET", "http://www.anypage.com/", true)
xmlHttp.send()
xmlDoc=xmlHttp.responseText
alert(xmlDoc)
</script>

It is important that this work on the client side on a live site, is
there anyway to achive this?

Any ideas, suggestions, links to sites that can help me would be greatly
appreciated.

Thanks,
Chris Craft
0
Comment
Question by:CJCraft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 7

Expert Comment

by:John844
ID: 6295875
If the object is failing on the server side, then try:

Make sure that the MSXML objects are installed on the server.  They are installed with Windows 2000 (or
you can download them here (http://download.microsoft.com/download/xml/Install/3.0/WIN98Me/EN-US/msxml3.exe) for other operating systems):

The IUSR_<server machine name> user account will need to have permissions for this object.


If the error message is on the client side then you have bigger problems.  you cannot user createobject client side.  You will have to use object tags to define your object and then try to use it(I have never done this).
0
 
LVL 7

Author Comment

by:CJCraft
ID: 6295986
Hi,

Thanks for the tips. The error is coming from the client side and all of the script, vbscript, is being run from the client side also.

If I run it as a local file off my harddrive from say my desktop it will work fine but once I upload it to my web site it will generate the permission denied errors.

I thought you couldn't use Server.CreateObject on the client side but you could use CreateObject. It does seem to create the object. The line with CreateObject by itself doesn't get the error.

It seems to be related to the Internet Zone Security Level in IE. If I set it to low security, I can get it to work. And explains why it can work from the desktop too.

I'll try the object tags and maybe that will help.

Thanks again,
CJCraft
0
 
LVL 2

Expert Comment

by:MicOfLZ
ID: 6297007
hi cjcraft

I tried your code. after some time I got to get it working like this:

<script language="VBScript" type="text/vbscript">
     Set xmlHTTP = CreateObject("Msxml2.XMLHTTP")
     xmlHttp.open "GET", "http://www.kull.ch/default.asp", true
     xmlHttp.send
     alert(xmlHttp.responseText)
</script>

for me, there is no problem with default security in ie.

hope this helps
MicOfLZ
0
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 
LVL 7

Author Comment

by:CJCraft
ID: 6298214
Hi,

Did you get it to work once you uploaded it to a Web site too? Your code works off my desktop but not off my Web site. For example, if you save the file to say http://www.kull.ch/test.asp do you get a access denied error then. If not please verify that you have default level security for Internet Zone in IE.

Thanks,
CJCraft
0
 
LVL 2

Accepted Solution

by:
MicOfLZ earned 300 total points
ID: 6301237
I run the page from my webserver. The only error I get is the one because of the async = true.

Try this:

<script language="VBScript" type="text/vbscript">
    Set xmlHTTP = CreateObject("Msxml2.XMLHTTP")
    xmlHttp.open "GET", "http://www.kull.ch/default.asp", false
    xmlHttp.send
    alert(xmlHttp.responseText)
</script>

I have default security options in my IE.
0
 
LVL 4

Expert Comment

by:chabaud
ID: 6319218
Why don't you try something like this instead:

<HTML>

<xml id="oXml" src="http://www.anypage.com/" />

<script language="VBScript" type="text/vbscript">
     if oXml.readyState = "complete" then
          alert( oXml.xml)
     end if
</script>

</HTML>
0
 
LVL 27

Expert Comment

by:BigRat
ID: 6351471
Is this bit of script code sitting in an ASP page with runat=server mode?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question