What is the perfered method in .NET over MSXML using XMLHTTPRequest?

  • Thread starter Thread starter Michael McCarthy
  • Start date Start date
M

Michael McCarthy

using MSXML.dll, I have the following code:

XMLHTTPRequest tempXML = new XMLHTTPRequest();
string strURL = "http://someURIgoeshere.com/";
try
{
tempXML.open("GET", strURL, false, "", "");
tempXML.send(null);
e.Result = tempXML;
}

....no problem. Now I want to get an XML Nodelist from the responseXML
object of my result... I'm stuck there using MSXML.. following that, I
need to pick out some information using getElementsByTagName but I cant
get to that place.

Any info on both the MSXML version vs. the propper .NET way of doing it
would be great... I'm thinking it would deal w/ an HTTPWebRequest, but I
haven't got THERE either.

regards,
Michael McCarthy.
 
Michael McCarthy said:
using MSXML.dll, I have the following code:

XMLHTTPRequest tempXML = new XMLHTTPRequest();
string strURL = "http://someURIgoeshere.com/";
try
{
tempXML.open("GET", strURL, false, "", "");
tempXML.send(null);
e.Result = tempXML;
}

...no problem. Now I want to get an XML Nodelist from the responseXML
object of my result... I'm stuck there using MSXML.. following that, I
need to pick out some information using getElementsByTagName but I cant
get to that place.

Any info on both the MSXML version vs. the propper .NET way of doing it
would be great... I'm thinking it would deal w/ an HTTPWebRequest, but I
haven't got THERE either.

I'm not familiar with XMLHTTPRequest, so I don't know exactly what it
does, but if the idea is to read an XML document from HTTP, then
separating the concerns would seem to be a good idea. Use
HttpWebRequest to get a stream of data back from the web server, and
use XmlDocument.Load to load the stream into an XML document.
 
Back
Top