Load XML from the web

  • Thread starter Thread starter Dennis Myrén
  • Start date Start date
D

Dennis Myrén

The Load method of System.Xml.XmlDocument takes an URL.
You can also use XmlTextReader.
 
Then i think you have to use a HttpWebRequest to load the stream
before loading the XML.
This supports using a Proxy through the Proxy property.
 
Hi all!
I have a quick question. How can I do to load an xml document from the web.
Should I use the XMLDocument or some http class.

TIA,
Sebastián
 
and what if I'm behind a web proxy as I am...
The Load method does not allow for proxy credentials, does it?

I tried using the WebRequest and WebResponse with no luck...

Thanks,
Sebastián
 
there is also a default proxy you can specify in web.config or app.config
(or what have you), and I believe the XmlDocument.Load() method will utilize
this proxy if it is set. Try it.

<configuration>
<system.net>
<defaultProxy>
<proxy proxyaddress="http://localhost:3128" bypassonlocal="false" />
</defaultProxy>
</system.net>
</configuration>

-Dino
 
Back
Top