M
Marshall Cummings
Hello,
I have a Visual Basic application that communicates with a Java Servlet with
no problems. The code I am currently using to perform this simple
communication is as follows:
Dim strURL as String
Dim strFormData as String
strURL = "http://www.test.dnsalias.com/servlet/MyServlet"
strFormData = "message=This is a test."
netScore.Execute strURL, "Post", strFormData,"Content-Type:
application/x-www-form-urlencoded"
I need some Java code that does the same thing! Everything I try seems to
be wrong on some level or another - anyone know the correct way to do this?
I have tried things like the following:
URL url = new URL("http://java.sun.com/cgi-bin/backwards");
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println("string=" + stringToReverse);
out.close();
When I look at the data sent over the wire using a packet sniffer, the
information sent with the VB app is very different than with the java app;
the java app seems to have encoded the information where the VB app is
sending it as plain text (and much more information, as well). Any ideas as
to what could be going wrong?
Any help would be greatly appreciated! Thanks!
I have a Visual Basic application that communicates with a Java Servlet with
no problems. The code I am currently using to perform this simple
communication is as follows:
Dim strURL as String
Dim strFormData as String
strURL = "http://www.test.dnsalias.com/servlet/MyServlet"
strFormData = "message=This is a test."
netScore.Execute strURL, "Post", strFormData,"Content-Type:
application/x-www-form-urlencoded"
I need some Java code that does the same thing! Everything I try seems to
be wrong on some level or another - anyone know the correct way to do this?
I have tried things like the following:
URL url = new URL("http://java.sun.com/cgi-bin/backwards");
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println("string=" + stringToReverse);
out.close();
When I look at the data sent over the wire using a packet sniffer, the
information sent with the VB app is very different than with the java app;
the java app seems to have encoded the information where the VB app is
sending it as plain text (and much more information, as well). Any ideas as
to what could be going wrong?
Any help would be greatly appreciated! Thanks!