473,651 Members | 2,663 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlResolver.Cre dentials

I have this code from an example on the MSDN site:

Dim rdr As New XmlTextReader(" http://localhost/bookstore/book.xml")
rdr.XmlResolver .Credentials = CredentialCache .DefaultCredent ials
Dim doc As New XmlDocument
doc.Load(rdr)

However, I get an error under rdr.XmlResolver , saying that it is Write Only.
I have imported the appropriate namespaces (Net, Xml, Xml.Schema), yet it
says the code isn't valid.

I also had similar problems using
XmlValidatingRe ader.XmlResolve r.Credentials (complaining that it is
Write-only).

Does anyone know why?
Jul 4 '06 #1
1 2155


cashdeskmac wrote:
I have this code from an example on the MSDN site:

Dim rdr As New XmlTextReader(" http://localhost/bookstore/book.xml")
rdr.XmlResolver .Credentials = CredentialCache .DefaultCredent ials
Dim doc As New XmlDocument
doc.Load(rdr)

However, I get an error under rdr.XmlResolver , saying that it is Write Only.
You should use e.g.
Dim rdr As New XmlTextReader(" http://localhost/bookstore/book.xml")
Dim resolver as XmlUrlResolver = new XmlUrlResolver( )
resolver.Creden tials = CredentialCache .DefaultCredent ials
rdr.XmlResolver = resolver
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 4 '06 #2

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

Similar topics

2
8794
by: Showjumper | last post by:
I've got the following code. But the XSLTransform line is underlined by the blue squiggle and vs tells me c:\inetpub\wwwroot\Sites\RiderDesign\articles\test.aspx.vb(37): 'Public Sub Transform(input As System.Xml.XPath.IXPathNavigable, args As System.Xml.Xsl.XsltArgumentList, output As System.IO.Stream)' is obsolete: 'You should pass XmlResolver to Transform() method' What the heck does this mean? Thanks... Dim XMLDoc As New XmlDocument
4
5323
by: Erwin Gabler | last post by:
Trying to validate a document with a reference to a DTD ("PUBLIC" identifier): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE systems-description PUBLIC "-//foo/nono" ""> .... The DTD uses some kind of parameter entity with a reference to an entity file:
2
1627
by: Paul | last post by:
Hi I'm currently having a problem with XMLResolvers. To put it simply using the same stylesheet and the same xml I am getting different results. When using the code and style sheet below. I get the following. The first file I create, using the obsolete method, creates the text1.txt file correctly. It creates a file with just a single < in it.
1
2599
by: rocio | last post by:
I'm trying ti use the example in http://support.microsoft.com/default.aspx?scid=kb;en-us;330587#appliesto but doe s not work. I keep getting the error Public WriteOnly Property XmlResolver() as...is obsolete: Pass XmlResolver as Transfer() method. does anyone know of a good example to do this? Tx!
4
3978
by: damien morton | last post by:
Hi, I need some help... Im trying to use XmlValidatingParser with a custom XmlResolver. Im finding, however, that the custom resolver never gets called, and that the XmlValidatingParser acts as a non-validating parser I created a custom resolver called XmlBreakingResolver, whos GetEntity and ResolveUri methods have breakpoints set in them along with Debug.Assert(false). The breakpoints are never reached, and the the Asserts never...
2
1587
by: Bennett Smith | last post by:
Could anyone within Microsoft comment on the status of the XmlResolver class in upcoming versions of the .NET framework? I am particularly interested in hearing about any improvements in how PUBLIC and SYSTEM entity references are handled. My hope is that improvements have been made that would finally allow one to build an XmlResolver that provides XML Catalog capabilities as described in the OASIS-OPEN XML Catalogs Working Draft. ...
3
2380
by: Rouven Hertenstein | last post by:
Hi, I'm trying to test the vb.net-exercise "How to use a DataSet with the Office XP Chart Component and ASP.NET" on http://support.microsoft.com/kb/303016/en-us Visual Studio rails against the expression: "xslTran.Transform(xmlDoc_ds, Nothing, context.Response.Output)" and comments: "Public Sub Transform(input As System.Xml.XPath.IXPathNavigable, args As
1
1677
by: Keith Chadwick | last post by:
Have been doing a fair amount of reading but at this point no joy. The scenario is - XSL template is stored within db. - Template has a xsl:include statement as <xsl:include href="inc.template.methods.xsl"/> I now I have to pass a resolver when I use the load method so that it understands the xsl include as in:
0
981
by: George Durzi | last post by:
In pre v1.1, this is how I would do an Xsl transformation: System.IO.FileStream fs = new System.IO.FileStream(sFilePath, System.IO.FileMode.Create); System.Xml.XmlTextWriter xtw = new System.Xml.XmlTextWriter(fs, System.Text.Encoding.Unicode); try { XmlDataDocument xmlDoc = new XmlDataDocument(SomeDataSet); System.Xml.Xsl.XslTransform xslTran = new System.Xml.Xsl.XslTransform();
0
8352
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
8275
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
8802
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
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...
0
8579
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
6158
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
4144
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...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2699
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

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.