473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Reading XML file from http

Hi;

I am trying to test reading a html file over http. So in IIS I create a
virtual directory and then in my NTFS permissions I set that directory to
only allow read from Domain Users. (I also allow control by admin).

I then access it using:
XmlDocument xmlDoc = new XmlDocument();
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = new NetworkCredential(username, password);
xmlDoc.XmlResolver = resolver;
xmlDoc.Load(filename);

However, I have two problems. The first is if I access the file via IE
using: http://lumiere.windward.local/domain...st_no/test.xml I am not
prompted for a username/password. I believe that having the .windward.local
means that my credentials are not passed to the server so shouldn't I be
prompted.

Second, when I use the above code and pass a bad password, I am able to
access the file.

Obviously I am doing something wrong. Any ideas what?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Dec 23 '06 #1
2 2184
You need to turn off Allow Anonymous Access from the IIS admin.

Chuck
David Thielen wrote:
Hi;

I am trying to test reading a html file over http. So in IIS I create a
virtual directory and then in my NTFS permissions I set that directory to
only allow read from Domain Users. (I also allow control by admin).

I then access it using:
XmlDocument xmlDoc = new XmlDocument();
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = new NetworkCredential(username, password);
xmlDoc.XmlResolver = resolver;
xmlDoc.Load(filename);

However, I have two problems. The first is if I access the file via IE
using: http://lumiere.windward.local/domain...st_no/test.xml I am not
prompted for a username/password. I believe that having the .windward.local
means that my credentials are not passed to the server so shouldn't I be
prompted.

Second, when I use the above code and pass a bad password, I am able to
access the file.

Obviously I am doing something wrong. Any ideas what?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
Dec 24 '06 #2
that was it - thanks!!

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm


"David Thielen" wrote:
Hi;

I am trying to test reading a html file over http. So in IIS I create a
virtual directory and then in my NTFS permissions I set that directory to
only allow read from Domain Users. (I also allow control by admin).

I then access it using:
XmlDocument xmlDoc = new XmlDocument();
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = new NetworkCredential(username, password);
xmlDoc.XmlResolver = resolver;
xmlDoc.Load(filename);

However, I have two problems. The first is if I access the file via IE
using: http://lumiere.windward.local/domain...st_no/test.xml I am not
prompted for a username/password. I believe that having the .windward.local
means that my credentials are not passed to the server so shouldn't I be
prompted.

Second, when I use the above code and pass a bad password, I am able to
access the file.

Obviously I am doing something wrong. Any ideas what?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Dec 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: deko | last post by:
Do I need to use flock() when reading a file into an array? It's possible that the file in question could be open at the time the file('filename') request is made. I realize flock() is required...
4
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # to open a file and write to file # do f=open('xfile.txt','w') # this creates a file "object" and name it f. # the second argument of open can be
3
by: Steven Burn | last post by:
The application; Service on my webserver that allows a user to upload their HOSTS file for functions to verify the contents are still valid. Uses; 1. XMLHTTP (MSXML2) 2. FileSystemObject...
7
by: Shane | last post by:
Hi, Thanks in advance for the help. I have been to many websites and tried several solutions to my problem, but have fixed part of it. It's time to come humbly to the newsgroups for help :-) ...
19
by: Lionel B | last post by:
Greetings, I need to read (unformatted text) from stdin up to EOF into a char buffer; of course I cannot allocate my buffer until I know how much text is available, and I do not know how much...
6
by: Rajorshi Biswas | last post by:
Hi folks, Suppose I have a large (1 GB) text file which I want to read in reverse. The number of characters I want to read at a time is insignificant. I'm confused as to how best to do it. Upon...
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
7
by: John Dann | last post by:
I'm trying to read some binary data from a file created by another program. I know the binary file format but can't change or control the format. The binary data is organised such that it should...
30
by: siliconwafer | last post by:
Hi All, I want to know tht how can one Stop reading a file in C (e.g a Hex file)with no 'EOF'?
2
by: Jean-Marie Vaneskahian | last post by:
Reading - Parsing Records From An LDAP LDIF File In .Net? I am in need of a .Net class that will allow for the parsing of a LDAP LDIF file. An LDIF file is the standard format for representing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.