OutputStreamWriter.close()
From: marshall (marshallgarza_at_yahoo.com)
Date: 07/13/04
- Next message: chuck: "J# no longer responding"
- Previous message: Gene Black: "RE: J# Browser Controls v1.1b Official Release"
- Messages sorted by: [ date ] [ thread ]
Date: 13 Jul 2004 06:08:57 -0700
I get an exception when I close the OutputStreamWriter object...
writer.close() in the following snippet of code. The excpetion is as
follows:
"at com.ms.vjsharp.protocol.http.VJSHttpOutputStream.close() at
java.io.OutputStreamWriter.close() at my code"
What am I doing wrong? Any advice or constructive criticism is greatly
appreciated.
string xml = doc.OuterXml;
//start
// Create the URL and URL Connection
URL url = new URL("http", dbHostname, Convert.ToInt32(dbHostPort),
"");
URLConnection uc = url.openConnection();
HttpURLConnection conn = (HttpURLConnection) uc;
// Set the connection for output and write the data.
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setAllowUserInteraction(true);
conn.setRequestProperty("Authorization","Basic " + dbUsername + ":" +
dbPassword);
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
//conn.setRequestProperty("Content-Length", Integer.toString(xml.Length)
);
conn.setRequestProperty("Connection","Keep-Alive");
conn.setRequestProperty("Proxy-Connection","Keep-Alive");
conn.setRequestProperty("Content-Type","text/xml");
conn.setRequestMethod("POST");
//conn.connect();
// Create a writer to the url
OutputStreamWriter writer = new
OutputStreamWriter(conn.getOutputStream());
// Send the xml query to the server
writer.write("Hello");
writer.flush();
writer.close();
- Next message: chuck: "J# no longer responding"
- Previous message: Gene Black: "RE: J# Browser Controls v1.1b Official Release"
- Messages sorted by: [ date ] [ thread ]