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 ? 


0
9/14/2005 12:03:31 PM
dotnet.xml 7266 articles. 0 followers. Follow

6 Replies
1094 Views

Similar Articles

[PageSpeed] 40


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/
0
mahotrash (1777)
9/14/2005 12:25:52 PM
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" <mahotrash@yahoo.de> wrote in message 
news:em7o0dSuFHA.4032@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/ 


0
9/14/2005 1:08:51 PM

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/
0
mahotrash (1777)
9/14/2005 1:47:55 PM
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" <mahotrash@yahoo.de> wrote in message 
news:eupOrLTuFHA.904@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/ 


0
9/14/2005 3:41:30 PM

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/
0
mahotrash (1777)
9/14/2005 4:35:32 PM
Actually that helped - many thanks :)

"Martin Honnen" <mahotrash@yahoo.de> wrote in message 
news:u47%23VpUuFHA.3252@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/ 


0
9/14/2005 11:03:32 PM
Reply:

Similar Artilces:

Ordering xml using xsl in c#
Hi, I have a xml dataset I'd like to order, and save in that order. I've written an xsl to do the transformation, but because the xml file has a xsd namespace, it doesn't work. A cutdown version of the xml file looks like this: <?xml version="1.0" standalone="yes"?> <hsPrinters xmlns:xsi="http://www.w3.org/2001/XMLSchema- instance" xmlns="http://tempuri.org/printer.xsd"> <city> <code>LN</code> <name>London</name> <comment>Herbert Smith London Offices</comment> </ci...

Sales Order lot extended quantity error
Good day. Kindly confirm if this is a system bug. I am using standard GP9.0 build 301. When I create an order/invoice transaction in SOP that requires a change in the default side ID. The lot's extended quantity is incorrect. I have below the procedures I did that gave me the incorrect computation. Below is the revised procedure to better explain where I can see the error: Procedure: 1. Setup option for SOP should NOT be [Auto-Assign Lot Number] 2. Complete header information - Create a Sales Transaction Entry with Type=Order. Use the default site ID. 3. Click [Show Details] button...

Upgrade CRM operating system and SQL server
Hi all, I have CRM set up as the following, Machine 1: CRM 3.0 server - window 2000 advance server Machine 2: SQL server - Window 2000 advance server with SQL 2000 server, report server 2000. I plan to upgrade these 2 machines to window 2003 and SQL server 2005. Anyone has ideal what is the best sequence to perform the upgrade? Operating System first? Is there anything needs to take note when performing the upgrade? I really appreciate if anyone can give the instruction on how to upgrade the OS and SQL in CRM enviroment. Thank you, Best regards, Ken I am not a great fan of upgra...

Formula Help
Hello, I have searched the web but can't seem to find the solution for this problem. I have a string of data in a column of cells that look like this: COMPANY NAME Contact Person Address COMPANY NAME Contact Person Address I need to pull the company name (which are in all caps) from the first part of this string for each cell. How do I get Excel to pull the company name (anywhere from 1 words to 6 or 7 words) and leave the rest? Thanks in advance for your help! HI, Try this. ALT+F11 tp open Vb editor. Right click 'This workbook' and insert module and pas...

Parsing Question
I've done parsing where you have one delimiter such as a comma or space. What if you have more than one? Example data: sStr(0) = "3/9" sStr(1) = "3/11 3/15-" sStr(2) = "3/8+ 3/12" sStr(3) = "3/9 3/15" sStr(4) = "3/8- 3/10+ 3/15" The strings above are Month/Day with some having an additional - or + character next to it. These dates are extracted from Excel cells as strings. I need to break those strings down into individual dates. So for sStr(4), I need to parse out "3/8", "3/10" and "3/15&...

Email file corrupt?
Yesterday I somehow managed to erase the boot sector from my HD and it took a whole day to recover my partitions which were left fully intact. My system had been in hibernation mode before that, but when I got back to the windows desktop I found I was frozen out (even task manager wouldn't come up) and I had no alternative but to reset. Problem was, outlook express was open when I hibernated. When I reset, I started outlook and all seemed fine. A couple of hours later though, I started getting GPFs (or whatever XP calls them) when I tried to reply to email, or double click one to view ...

Problem opening serialized file via Open command associated with file type
I have an SDI MFC application that produces a serialized project file via CObject's serialization support. The application can read the file from within the application just fine. The installer registers the program and the file extension properly and associates the file type with the application. However, when I double click on the project file, the application generates an "Unexpected File Format" message. Is there a method in the document class that needs to added to handle this functionality? I want to try and debug the problem but not sure how to invoke the debugg...

Changing the Money 2004 data file a Pocket PC uses
I have Money on my Pocket PC. I was satisfactorily synchronising with Money on my desktop. I had to change the data file on the desktop. Having done that, I deleted the old data on the Pocket PC. However, when I go to load from the new file, only one Money Account (eg Visa, Cash, etc. shows up in the list from which to select those to synchronise - Investments to Watch. (On the page found by selecting 'Microsoft Money' in the list in ActiveSyn.) Can anybody save me the $50 minimum Microsoft wants to charge me? (Which is a bit stiff given that Money 2004 is not a product...

Inserting files into excel worksheets
Why is there no option for inserting an files into an existing Excel worksheet similar to the option forinserting files into Word and PowerPoint files. I work for a CPA firm and this would be a valuable feature feature. "ccwies" <ccwies@discussions.microsoft.com> wrote in message news:FFC33867-4C40-45F8-89E0-540ABD94AC3C@microsoft.com... > Why is there no option for inserting an files into an existing Excel > worksheet similar to the option forinserting files into Word and > PowerPoint > files. I work for a CPA firm and this would be a valuable feature feature...

Data not valid error message
Access02 Have a Report which appears fine. But when you go from DesignView to ReportView it throws error: ~.."the data you entered for this field is not valid"... it doesn't say which field.....I can click thru the message and it reprompts this a few times (probably once per instance of invalid) and then opens fine. it does not do this when the Report opens ; only changing from design view... but it does do it if it is multipage and you need to go to the next page....so needs to be fixed... there's alot of fields and so am wondering how to troubleshoot....hunch is t...

Sync Outlook files
Using Outlook 2003 Can anyone tell me an easy way to sync a laptop outlook files with my desktop's outlook files. Thanks Check out http://www.slipstick.com/outlook/sync.htm -- PATRICK REED [Outlook - MVP]~~~~~~ -Microsoft Certified Professional (MCP) -Have you checked http://www.slipstick.com? -Please post your Outlook version! "Shane Nation" <Shane@nation22.freeserve.co.uk> wrote in message news:ulHTz1%23PEHA.624@TK2MSFTNGP11.phx.gbl... > Using Outlook 2003 > > Can anyone tell me an easy way to sync a laptop outlook files with my > desktop's ...

how to parse <?xml version="1.0" encoding="UTF-8"?> with xpath? is it possible?
how to parse <?xml version="1.0" encoding="UTF-8"?> with xpath? is it possible? "Daniel" <softwareengineer98037@yahoo.com> wrote in message news:%23g11DbDOGHA.2176@TK2MSFTNGP10.phx.gbl... > how to parse <?xml version="1.0" encoding="UTF-8"?> with xpath? is it > possible? No -- the xml declaration is not represented in the XML Infoset. Cheers, Dimitre Novatchev ...

How can a split a PUB file into multiple parts?
I cannot find the way to divide a large (150 pg) PUB file into smaller parts. I also want to find out how to extract a single page (the cover) and open only it as a new file. Save your publication with a new name. What version Publisher? If you have 2007 you can select consecutive pages by pressing shift and selecting the page tabs you want to delete. Or press control if the pages are not consecutive. Once deleted, save as a new file. Open the old file again, delete all the pages you don't want and save again with a new name and so on until you have all the sections you need. If ...

Outlook 2000
Is there some way of copying emails in my Outlook 2000 personal folder in a format that can be read by MS Word. ...

EXE error in Windows 95/98
41Hello. I hope this is the correct discussion group. I have a win32 application developed in VC++ with MFC. They worked fine in all Windows version (win 9x, 2000, xp), until last month. Now they work fin in Windows 2000 and XP but in Windows 95/98 they report an error when I try to execute it. The error: "The file xxxxxx.exe seem to be damaged. Install it again and try again" or so (i have translate the error to english). I have these error in various PC, all in Win 9x, but in Win 2000 and XP work correctly. I have restore a copy of a old version of my application from one m...

Locating xmlns nodes in XML documents (for XML document metrics)
I've been writing an XML document analyzer that reads XML document and tracks the metrics of the document. Statistics such as a node count fo each type of XML node are printed out I am trying to locate 'xmlns' nodes using the XPath (not DOM or SAX) API Unfortunately the XPathNavigator concept of namespace nodes for eac element is only accessible via MoveToFirstNamespace() an MoveToNextNamespace(). The XPath model constructs a namespace node lis for EACH ELEMENT where each namespace node represents a namespace CURRENTL IN SCOPE for the current XML node I would like to easily loca...

POS 911 Error
Hello, I'm getting a 911 Error and it won't open my Cash Drawer. Does anyone know what is it and how to fix this? Any help would be great! Thanks, Jim 99% chance that there's a problem with your receipt printer - make sure it is not showing any errors(including out of paper)! Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.com ---------------------------------------------- Please DO NOT respond to me directly but post all responses here in the newsgroup so that all can share the information. Sonu.NET wrote: > Hello, > > I'm ge...

Purge mailbox error
I moved a mailbox from Ex5.5 to Ex2003 Before that I took a backup (only that one mailbox) wit Veritas Backup Exec After moving the mailbox wasn't working anymore I deleted mailbox (2003) but somehow it did'nt delete at all Then I made a new mailbox (new name, 5.5) and I gave adminisitrato owner permissions on this mailbox (only way to restore backup) The restore went fine (to 5.5 Now I can't delete (PURGE) the old mailbox (2003) because it stil acclaims that the mailbox is already reconnected to an existing user Error message (Exhange System Monitor) ID no: c1034ad6 What can I do?...

Show last files used in File dropdown menu
The File dropdown menu has always shown the last 3 files I used at the bottom of the menu, but someone in my family has done something to turn this feature off. How do I turn it back on? I know this is a simple question, but I can't seem to get a simple answer!! Thanks so much to whomever can help me with this. Best, Ladywulfe Go to Tools <>options<.general tick the "recently used file list" -- Greetings from New Zealand Bill K "Ladywulfe" <Ladywulfe@discussions.microsoft.com> wrote in message news:C0C0AF67-32F6-47FF-AFC8-D5006232BB8E@microso...

What's the name of the file that stores AutoComplete addresses
My Outlook had to be re-installed and I lost my contact list which is very large. I see several files in the recycle bin. Is one of them by contacts? Autocomplete cache is an NK2 file, named for your profile, often outlook.nk2. Paste the following line in the address bar of windows explorer; %USERPROFILE%\Application Data\Microsoft\Outlook and it will open to the folder where its stored. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subsc...

Parsing cells
Hi Folks, I have data in cells which is OCR`d from my phone bill, and some of the info is corrupt. Where I should be getting eg. 17 Nov 14:49 for date/time I am getting O17 Nov 14:49 or C17Nov 14:49. The reason is that there are unreadable icon characters to signify day or night. Questions: 1)How do I remove the faulty characters......they are always the first digit in the date if they are there. 2)How can I seperate the date and time into two adjasent colums of cells rather than their current format in one cell. Any and all help greatly appreciated. John Hi John You ca...

What is the quickest way to get an xml based dataset to add entries to SQL Server?
Because there is no 'datareader' involved, what is the most efficient way to get an XML based dataset to be added to an SQL server dataset? I would hate to have to create a new SQL connection and iterate through making "executenonquery" for each row in the dataset. That seems horribly in-efficient. I know of no other way to get an xml based dataset to push data to the database though. Any pointers? Thanks for any pointers, Peter Robbins Freelance Programmer C#/PHP "MurdockSE" <murdock@nc.rr.com> wrote in message news:1153922058.675709.165630@h48g2000cwc.go...

SRS (CRM_Locale) is set to false (Error when trying to view report
Hi When a user including CRM Administrator tries to access any report from reporting services they get the following error: "The property 'nullable' of report parameter 'CRM_Locale' is set to false. However, the corresponding parameter (default) value is null or contains an empty string. (rsProcessingError)" I can open the reporting server's site in a browser seperate from CRM and view the list of reports but I get the same error. But my CRM reports properly functioning at CRM clients Any usefule suggestions? Cheers Pareek Hi, I have exactly the same issue...

SSRS subscription
I am new to SSRS and currently struggling with subscriptions. I have created one (Delivered by: Windows File Share) for a simple report. No matter what I try I keep getting "Failure writing file Report1 : The report server has encountered a configuration error. See the report server log files for more information." Log file shows: w3wp!library!1!01/06/2010-11:06:00:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedNativeModeException: The operation is not supported on a report server that runs in native mode., ; Info: M...

Inport/Eport XML
I am running Microsoft Office 2000 on my work computers. I am editing a database and I need said database to export a table named Data Table to a .xml file. I also need to be able to import a .xml file and have it added to the same table. I don't know if 2000 has the capability. Check your VBA references for an XML library. I am using 2003 and we have it. You use the xmlExport and xmlImport methods to do that. -- Dave Hargis, Microsoft Access MVP "Bobby.Dannels@gmail.com" wrote: > I am running Microsoft Office 2000 on my work computers. I am editing > a database a...