473,836 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(F ileLocation);
XPathNavigator xPathNavigator = xPathDocument.C reateNavigator( );
XPathNodeIterat or nodeIterator = xPathNavigator. Select("/plist/dict");
nodeIterator.Mo veNext();
nodeIterator = nodeIterator.Cu rrent.SelectChi ldren(XPathNode Type.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 8370


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

XPathDocument xPathDocument = new XPathDocument(F ileLocation); 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#sec1 0.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/cpconaccessingi nternetthroughp roxy.asp>
helps.
--

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

"C:\Documen ts and Settings\Jeremy B\Desktop\Libra ry.xml"

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

"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:em******** ******@TK2MSFTN GP15.phx.gbl...


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

XPathDocument xPathDocument = new XPathDocument(F ileLocation);

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#sec1 0.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/cpconaccessingi nternetthroughp roxy.asp>
helps.
--

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

Nov 12 '05 #3


JezB wrote:
It's something like :

"C:\Documen ts and Settings\Jeremy B\Desktop\Libra ry.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(F ileLocation);

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


JezB wrote:
It's something like :

"C:\Documen ts and Settings\Jeremy B\Desktop\Libra ry.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(F ileLocation);

Does it have to ? Can this be bypassed ?


I think you can try
XmlTextReader xmlReader = new XmlTextReader(F ileLocation);
xmlReader.XmlRe solver = null;
XPathDocument xPathDocument = new XPathDocument(x mlReader);
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*******@yaho o.de> wrote in message
news:u4******** ********@TK2MSF TNGP10.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(F ileLocation);

Does it have to ? Can this be bypassed ?


I think you can try
XmlTextReader xmlReader = new XmlTextReader(F ileLocation);
xmlReader.XmlRe solver = null;
XPathDocument xPathDocument = new XPathDocument(x mlReader);
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
4982
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 proxyObject = new WebProxy("abc-dc", 8080) proxyObject.BypassProxyOnLocal = True GlobalProxySelection.Select = proxyObject
2
2679
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 Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. " How the hell can i connect to the remote webservice ? Thank you so much in advance.
2
1536
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 Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. " How the hell can i connect to the remote webservice ? Thank you so much in advance.
5
1767
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 app on an sbs 2003 (windows 2003 + ISA 2000) server. I suspect ISA 2000 is the problem but don't know where and how to give proxy credentials in the whole publishing and installing process. Any help to fix this will be appreciated. Thanks
0
1166
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 = CredentialCache.DefaultCredentials; req.PreAuthenticate = true; req.Proxy = p; req.Credentials = CredentialCache.DefaultCredentials; WebResponse res=req.GetResponse();
0
1869
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 server returned an error: (407) Proxy Authentication Required.>. Your DOCTYPE is probably incorrect. If you're not sure what the DOCTYPE should be, use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >, Visual Studio .NET's default. *...
0
1436
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 facing "The Remote server returned an error :(407) Proxy Authentication Required " Please help me on this proxy issue!! Code Snippet Below:::
3
25815
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 facing "The Remote server returned an error :(407) Proxy Authentication Required " {
3
5482
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 = System.Net.FileWebRequest.Create( "http://store.bearvalley.com/live/camimage_00001.jpg"); response = request.GetResponse(); When it tries to execute the request.GetResponse() call I get the following
0
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9672
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10559
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10601
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10260
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.