
Signature
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------
Alvin,
I found a webclient class but no webrequest class.

Signature
Arne Garvander
Certified Geek
> have a look at the webrequest class
>
> > How do I make a HTTP request from a class?
> > I am writing a component that will run outside of the webserver. This
> > component will send xml files to another http server. I am not using SOAP.
Alvin Bruney - ASP.NET MVP - 07 Mar 2006 16:37 GMT
WebRequest myWebRequest = WebRequest.Create(str.ToString());
// Set the 'Timeout' property in Milliseconds.
#warning timeout value was set to 10000 for testing purpose
myWebRequest.Timeout = 10000;
// This request will throw a WebException if it reaches the timeout limit
before it is able to fetch the resource.
// ProductData _data = new ProductData();
DataSet ds = new DataSet("test");
try
{
WebResponse myWebResponse = myWebRequest.GetResponse();
StreamReader reader = new StreamReader(myWebResponse.GetResponseStream());
XmlTextReader read = new XmlTextReader(reader);
ds.ReadXml(read);
}
catch(WebException ex)
{
Debug.WriteLine(ex.Message);
throw;
}

Signature
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------
> Alvin,
> I found a webclient class but no webrequest class.
[quoted text clipped - 4 lines]
> > > I am writing a component that will run outside of the webserver. This
> > > component will send xml files to another http server. I am not using SOAP.