473,813 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Loading XmlDocument with a file on network?

Can you load an XmlDocument with a file located on a network share? I thought maybe the XmlResolver could be used

XmlUrlResolver resolver = new XmlUrlResolver( )
resolver.Creden tials = CredentialCache .DefaultCredent ials
// Create and load the XmlDocument
XmlDocument doc = new XmlDocument()
doc.XmlResolver = resolver; // Set the resolver
doc.Load(@"\\de vsrv\profiles\0 004.xml")

OR..

doc.Load("//devsrv/profiles/0004.xml")

But I get: "Logon failure: unknown user name or bad password"
Nov 12 '05 #1
1 2516
The problem is probably that the account that your application is running
under does not have access to the network share. Are you trying to read the
XML document from a desktop app or a Windows service (like ASP.NET for
example)

--
Christoph Schittko [MVP]
Software Architect, .NET Mentor

"Dave" <an*******@disc ussions.microso ft.com> wrote in message
news:6C******** *************** ***********@mic rosoft.com...
Can you load an XmlDocument with a file located on a network share? I thought maybe the XmlResolver could be used.
XmlUrlResolver resolver = new XmlUrlResolver( );
resolver.Creden tials = CredentialCache .DefaultCredent ials;
// Create and load the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.XmlResolver = resolver; // Set the resolver.
doc.Load(@"\\de vsrv\profiles\0 004.xml");

OR...

doc.Load("//devsrv/profiles/0004.xml");

But I get: "Logon failure: unknown user name or bad password"

Nov 12 '05 #2

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

Similar topics

5
5893
by: Morten Nielsen | last post by:
I'm trying to load an XML file, that references a DTD without a relative URL. This renders the error: Could not find file "C:\WINNT\system32\capabilities_1_1_0.dtd". Here's the XML I'm loading: http://maps1.intergraph.com/wms/ussample/request.asp?SERVICE=WMS&REQUEST=GetCapabilities Notice the DTD reference at the second line: <!DOCTYPE WMT_MS_Capabilities SYSTEM "capabilities_1_1_0.dtd" http://www.iter.dk/contact.aspx
0
597
by: Sonu Kapoor | last post by:
I tried the code and it works without any probs. The prob must be in your network. Maybe you have to reconfigure your Firwall. Sonu http://weblogs.asp.net/sonukapoor/ >-----Original Message----- >How do I load a remote xml file into the DateSet or into System.Xml.XmlDocument on a WEB Application.
7
19236
by: Christofer Dutz | last post by:
Hi, I am trying to read a XML-File which I marked as embedded resource from within the code of my DLL. Unfortunately it doesn't work. On my search for the error I inserted some code for outputing all Resources names to a simple textfile. Here nothing is output. Here my code (a little messy after about 3 hours of debugging): // Use the LoadXml method to load the XslTransform
4
3430
by: Gustaf Liljegren | last post by:
This may be a question of taste, but if there is a best practice, I want to know. I have two choises: SomeClass s = new SomeClass(file); // Load the file or SomeClass s = new SomeClass(); s.Load(file); // Load the file
7
1729
by: emma_middlebrook | last post by:
Hi In one of our test suites we load an xml document (it's actually .svg). I'm trying to find some way of stopping the eventual call to HttpWebRequest.GetResponse which I presume it's doing when going to get the DTD at "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd". The result is a time-out because this machine is isolated from the database, the web, everything really :-) I tried to pass XmlDocument a non-validating reader...
0
2208
by: speedcoder | last post by:
hi all, i'm stumped. my applet used to load images over the network. (it was actually designed by someone else.) yes, the applet used to load each image file independently over the network and incurred a network hit per image file. i wanted to avoid the overhead of a separate network connection for each image file, so i bundled all the images into the JAR file. yet, somehow, the loading time for the applet is slower now! i'm totally...
1
9440
by: Pesci Drums | last post by:
Hey There!... I've been dealing for hours trying to figure out why do I get the following error message: Type 'System.Xml.XmlDocument' in Assembly 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. I'm using the following method to get the XML:
6
5069
by: cmorgan76 | last post by:
This is a 2 part question: Part 1: I am accesing a web service that returns an xml string of user information. I am attempting to load the XML into an XMLDocument, save the document, load it into a dataset, and bind the dataset to a gridview. I'm not sure if it's neccesary to save the XML file to disk, but I wanted to make sure it was well formed. It is. No exceptions are caught during the loading and binding process, but my gridview...
1
1168
by: sasiphyd | last post by:
I have used an ajax file furnaces.html with code as below.The file furnacedata.php is used to generate XML dynamically and this appears to working well. timerID is used to reload the XML data at intervals of 1000ms. This code appears to be working in some PCs and not in others. It is not giving a reliable output. can anybody help? Code: <head> <script language="JavaScript" type="text/JavaScript"> function getfurnacedata() { var...
0
9734
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
9607
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,...
1
10422
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
10139
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...
0
9222
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7681
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
5568
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3030
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.