473,408 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Posting to web app and reading result

Hello I'm an ASP newbie needing to translate a JAVA program into ASP. I
have a servlet that posts data to another servlet and reads back the
response. I was wondering how I could do the same in ASP. The bits of Java
code are:

HttpURLConnection conn = null;
try
{
URL url = new URL(urlStr);
System.out.println("Opening connection to: " + urlStr);
conn = (HttpURLConnection)url.openConnection();
conn.setDoOutput(true);

System.out.println("Sending data to url");
PrintWriter out = new PrintWriter(conn.getOutputStream());
out.println(text);
out.close();

System.out.println("Reading response.");
BufferedReader in = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String inputLine;
StringBuffer sb = new StringBuffer();

while ((inputLine = in.readLine()) != null)
{
sb.append(inputLine);
}

in.close();
System.out.println(sb.toString());
} catch (Exception e)
{
System.out.println(e.getMessage());
}

Any pointers greatly appreciated.

SB
Nov 19 '05 #1
2 883
Stanley Beamish wrote:
Hello I'm an ASP newbie needing to translate a JAVA program into ASP.
I have a servlet that posts data to another servlet and reads back the
response. I was wondering how I could do the same in ASP. The bits
of Java code are:


ASP? Then you're wrong here.

ASP.NET? See System.Net.WebClient, which is an easy to use wrapper for
the lower level HttpWebRequest/HttpWebResponse classes.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #2
"Stanley Beamish" <so*****@microsoft.com> wrote in message
news:KQ*****************@fe3.news.blueyonder.co.uk ...
I was wondering how I could do the same in ASP.


You could start by posting your question in the correct newsgroup:
microsoft.public.inetserver.asp.general

This newsgroup is for ASP.NET
Nov 19 '05 #3

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

Similar topics

2
by: Dariusz | last post by:
Below is part of a code I have for a database. While the database table is created correctly (if it doesn't exist), and data is input correctly into the database when executed, I have a problem...
0
by: travis ray | last post by:
Hi, I have an extension in which a file object is created in python and passed down to a c extension which attempts to read from it or write to it. Writing to the file pointer seems to work...
6
by: KC | last post by:
How would I post data from a listbox that allows multiple selections? How do you join the name/value pairs for the posted data? And for extra credit: Where is a page posting to when there is no...
3
by: Peter Afonin | last post by:
Hello, I'm posting the data to another page and reading the results. I'm doing it approximately as described here: http://authors.aspalliance.com/stevesmith/articles/netscrape2.asp It works...
2
by: Joe | last post by:
Anyone can suggest the best method of reading XML and adding data to ListView? Here is the xml data structure:: <xml> <site> <url>http://www.yahoo.com</url> <lastupdate></lastupdate>...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.