xmlDocument.Load - (401) Unauthorized

  • Thread starter Thread starter Roman
  • Start date Start date
R

Roman

I am trying to load an XML file using 'Load' method on a
XmlDocument object.

xmlDocument.Load("http://localhost/Test.xml");

In return I am getting an exeption; "The remote server
returned an error: (401) Unauthorized.".
 
Roman said:
I am trying to load an XML file using 'Load' method on a
XmlDocument object.

xmlDocument.Load("http://localhost/Test.xml");

In return I am getting an exeption; "The remote server
returned an error: (401) Unauthorized.".

And what's serving up the XML? Does it expect authorization of some
kind? Check whether it's actually getting the request, or whether it's
being proxied somehow.
 
All I can see in the log file is: 18:15:49 127.0.0.1
GET /Parsers/Ess/1.0.0.0/Map.xml 401

Right. So it's getting to the right machine - you now need to look at
your configuration to find out why the request is being rejected.
 
Roman said:
I have a default configuration, anonymous access with
integrated windows authentication.

I suspect that XmlDocument.Load doesn't use Windows authentication. At
least, it's certainly worth trying the whole shebang without any
authentication at the server side, and see if that works.
 
Roman said:
Yes. From the browser it works fine

Well, use a network analyser and find out what difference there is
between what .NET does and what the browser does.
 
Back
Top