using WebClient, how??

J

Jeff

ASP.NET 2.0

I'm working on a asp.net 2.0 website which needs to access a database on
another server via an request. This database is placed on another server
which is not based on ASP.NET, but traditional ASP. The ASP.NET may access
the database on the other server by requesting a .asp page with some
parameters - and hte output on the .asp page was the result from the
database query... So I need to access a asp page on this other server via an
request as from using an object of the WebClient class. The output from the
..asp page will be returned back to the ASP.NET 2.0 website for processing...

For example like this:
www.test.com\index.asp?user=newbie&pword=insecure
How can I access this page from my ASP.NET 2.0 website by using WebClient?

Or is it a much better approach to install .NET 2.0 on this server and
implement a web service instead (the server is a windows server) so my
ASP.NET 2.9 website can access it by using a webservice instead?

Any suggestions???

Jeff
 
B

bruce barker

asp has simple webservice support. webclient is simple, but you will
need to parse the response data.


-- bruce (sqlwork.com)
 
G

Guest

ASP.NET 2.0

I'm working on a asp.net 2.0 website which needs to access a database on
another server via an request. This database is placed on another server
which is not based on ASP.NET, but traditional ASP. The ASP.NET may access
the database on the other server by requesting a .asp page with some
parameters - and hte output on the .asp page was the result from the
database query... So I need to access a asp page on this other server via an
request as from using an object of the WebClient class. The output from the
.asp page will be returned back to the ASP.NET 2.0 website for processing...

For example like this:www.test.com\index.asp?user=newbie&pword=insecure
How can I access this page from my ASP.NET 2.0 website by using WebClient?

Or is it a much better approach to install .NET 2.0 on this server and
implement a web service instead (the server is a windows server) so my
ASP.NET 2.9 website can access it by using a webservice instead?

Any suggestions???

Jeff


I think you can use System.Net.HttpWebRequest

for example:

HttpWebRequest request =
(HttpWebRequest)HttpWebRequest.Create("http://...page.asp");
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string asp = reader.ReadToEnd();

Using xml as an output you can easily parse it as per

XmlDocument xml = new XmlDocument();
ResponseXmlDoc.LoadXml(asp);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top