Open the connection:
URI url = new URL("http://localhost:8084/jaxp-lectrure/xslt-service.jsp"); // Opens a connection URLConnection uconnection = url.openConnection(); // Set the properties HttpURLConnection connection = (HttpURLConnection)uconnection; connection.setDoOutput(true); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type",contentType); connection.setRequestProperty("Content-Encoding","UTF-8"); // Setup the output for serialization OutputStream os = connection.getOutputStream(); OutputStreamWriter o = new OutputStreamWriter(os,"UTF-8");
Now you write your XML to the writer.