473,226 Members | 1,545 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,226 software developers and data experts.

Parsing an XML file, ERROR: The remote server returned an error: (407) Proxy Authentication Required. HELP!

I'm getting the above error thrown somewhere in the code:

XPathDocument xPathDocument = new XPathDocument(FileLocation);
XPathNavigator xPathNavigator = xPathDocument.CreateNavigator();
XPathNodeIterator nodeIterator = xPathNavigator.Select("/plist/dict");
nodeIterator.MoveNext();
nodeIterator = nodeIterator.Current.SelectChildren(XPathNodeType. All);

where FileLocation contains the full path of a local XML file. Why is this
trying to access the file via the proxy ? What can I do to fix this ?
Nov 12 '05 #1
6 8341


JezB wrote:
I'm getting the above error thrown somewhere in the code:

XPathDocument xPathDocument = new XPathDocument(FileLocation); where FileLocation contains the full path of a local XML file. Why is this
trying to access the file via the proxy ? What can I do to fix this ?


Well how does FileLocation look like? Is that a HTTP URL e.g.
http://example.com/document.xml
or
http://localhost/document.xml
The error message suggests that and that you get the HTTP status 407
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8>. That
is not an XML problem then but a problem on how your HTTP access is
going through a proxy. Perhaps
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaccessinginternetthroughproxy.asp>
helps.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
It's something like :

"C:\Documents and Settings\JeremyB\Desktop\Library.xml"

Why this has to go through a proxy is a mystery to me.

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:em**************@TK2MSFTNGP15.phx.gbl...


JezB wrote:
I'm getting the above error thrown somewhere in the code:

XPathDocument xPathDocument = new XPathDocument(FileLocation);

where FileLocation contains the full path of a local XML file. Why is
this trying to access the file via the proxy ? What can I do to fix this
?


Well how does FileLocation look like? Is that a HTTP URL e.g.
http://example.com/document.xml
or
http://localhost/document.xml
The error message suggests that and that you get the HTTP status 407
<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8>. That
is not an XML problem then but a problem on how your HTTP access is going
through a proxy. Perhaps
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaccessinginternetthroughproxy.asp>
helps.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '05 #3


JezB wrote:
It's something like :

"C:\Documents and Settings\JeremyB\Desktop\Library.xml"

Why this has to go through a proxy is a mystery to me.


Sounds odd indeed. Sorry, I don't understand why you would get 407 Proxy
Authentication Required for a local file access.
When I try to use XPathDocument on Windows XP to access a local file in
a directory of another user then I get a normal access denied to that
path which sounds right.
I have googled to find whether someone has reported a problem similar to
yours but not found anything.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #4
A-ha. The xml header in my local file has this:

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">

So it's trying to read schema information from the internet when it
executes:
XPathDocument xPathDocument = new XPathDocument(FileLocation);

Does it have to ? Can this be bypassed ?
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:eu*************@tk2msftngp13.phx.gbl...


JezB wrote:
It's something like :

"C:\Documents and Settings\JeremyB\Desktop\Library.xml"

Why this has to go through a proxy is a mystery to me.


Sounds odd indeed. Sorry, I don't understand why you would get 407 Proxy
Authentication Required for a local file access.
When I try to use XPathDocument on Windows XP to access a local file in a
directory of another user then I get a normal access denied to that path
which sounds right.
I have googled to find whether someone has reported a problem similar to
yours but not found anything.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '05 #5


JezB wrote:

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">

So it's trying to read schema information from the internet when it
executes:
XPathDocument xPathDocument = new XPathDocument(FileLocation);

Does it have to ? Can this be bypassed ?


I think you can try
XmlTextReader xmlReader = new XmlTextReader(FileLocation);
xmlReader.XmlResolver = null;
XPathDocument xPathDocument = new XPathDocument(xmlReader);
to suppress the access.

However if the DTD defines entities and the document references them you
could get problems. A complete solution would be to implement your own
resolver that for instance reads a locally safed version of the DTD when
the URL needs to be resolved.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #6
Actually that helped - many thanks :)

"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:u4****************@TK2MSFTNGP10.phx.gbl...


JezB wrote:

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">

So it's trying to read schema information from the internet when it
executes:
XPathDocument xPathDocument = new XPathDocument(FileLocation);

Does it have to ? Can this be bypassed ?


I think you can try
XmlTextReader xmlReader = new XmlTextReader(FileLocation);
xmlReader.XmlResolver = null;
XPathDocument xPathDocument = new XPathDocument(xmlReader);
to suppress the access.

However if the DTD defines entities and the document references them you
could get problems. A complete solution would be to implement your own
resolver that for instance reads a locally safed version of the DTD when
the URL needs to be resolved.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '05 #7

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

Similar topics

3
by: Greg Vereschagin | last post by:
I cannot get the following code to work when trying to download web pages through a proxy server: Dim wrq as Net.WebRequest Dim wrp as Net.WebResponse Dim proxyObject as WebProxy ...
2
by: Mr. Ali Hasan | last post by:
There's a problem in my application that calls a remote web service's method, when it tries to connect to the webservice it displays this error: "The request failed with HTTP status 407: Proxy...
2
by: Mr. Ali Hasan | last post by:
There's a problem in my application that calls a remote web service's method, when it tries to connect to the webservice it displays this error: "The request failed with HTTP status 407: Proxy...
5
by: John | last post by:
Hi When I try to install a published app using a url like http://www.mydomain.com/publish.htm, it starts the download but then comes up with the eror given at the end below. I am installing the...
0
by: =?Utf-8?B?c3VqaXRo?= | last post by:
try { WebRequest req = WebRequest.Create(@"http://www.google.com"); req.Method = "GET"; WebProxy p = new WebProxy(@"http://ganymede:8090", false); p.Credentials =...
0
by: Ambica | last post by:
I am using Nunitasp for testing .aspx pages.While running the test case in the GUI the following error occurs: NUnit.Extensions.Asp.DoctypeDtdException : Problems with DOCTYPE DTD: <The remote...
0
by: Learning.Net | last post by:
Hi All, I have an windows application created in C# &it is running fine on several of our customer. It does a httpWebrequest in the background. Everything was working fine but some customer are...
3
by: Learning.Net | last post by:
Hi All, I have an windows application created in C# &it is running fine on several of our customer. It does a httpWebrequest in the background. Everything was working fine but some customer are...
3
by: =?Utf-8?B?UmljaGFyZEBub3NwYW0ubm9zcGFt?= | last post by:
My webcam app runs OK on XP but not on Vista. Here's my code snippet that has been working up until now: System.Net.WebRequest request; System.Net.WebResponse response; request =...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.