Forums Register Login

Need to implement persistent SSL in java

+Pie Number of slices to send: Send
I need to send data from a client app to a IIS webserver. I have set in my code all the necessary stuff needed for persistent ssL, but the socket still closes. I have used both jdk1.3 and jdk1.4 but to no avail. Here's a sample of my code :
=========================================================
HttpURLConnection con = (HttpURLConnection)new URL(urlAddress).openConnection();
con.setRequestProperty ("Authorization", "Basic " + encoding);
con.setRequestMethod("POST");
con.setRequestProperty("HTTP-Version", "HTTP/1.1");
con.setRequestProperty ("Content-Type", "application/xml");
con.setRequestProperty ("Connection", "Keep-Alive");
con.setRequestProperty("Proxy-Connection", "Keep-Alive");
con.setRequestProperty ("Content-Length", ""+xmlStr.length());
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
con.connect();
===========================================
After that, I open a outputstream, then I write an xml to that url, then I close the stream, and open a reader stream to read the reply. That's basically it.
I did a check on the netstat log, and find out the socket always closes, and its initiated by my app not the IIS webserver.
Can anybody help? Thanks in advance.
+Pie Number of slices to send: Send
Hi Mr. T,
Welcome to JavaRanch!
We don't have too many rules round these parts, but we do have our naming policy, which requires that your display name not be an obviously fictitious name (even if you were the famous entertainer, his name is obviously fictitious, so we wouldn't let him use it either!) Pleae head over here and update yours, pronto. Thanks, pardner!
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1038 times.
Similar Threads
Java Http Server and Java Http Client
Some of you are experts this could be your next problem!
sending HTML form data using java code
HttpURLConnection - Luanch Browser
HttpUrlConnection - cXML PunchOutSetupRequest
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:03:27.