Solved

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

Posted on 2001-07-18
7
1,189 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
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now