Here is an example from an old project of mine connecting to a SharePoint web service. It should show you all the basics that you need.
try {
URL sharepoint = new URL("http://server.com/_vti_bin/Lists.asmx");
URLConnection sharepoint_connection = sharepoint.openConnection();
String body = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
" <soap:Body>" +
" </soap:Body>" +
"</soap:Envelope>";
System.out.println("~~~~~ Roadmap: " + body);
sharepoint_connection.setRequestProperty("Man", "POST /_vti_bin/Lists.asmx HTTP/1.1");
sharepoint_connection.setRequestProperty("Host", "server.com");
sharepoint_connection.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
sharepoint_connection.setRequestProperty("Content-Length", Integer.toString(body.length()));
sharepoint_connection.setRequestProperty("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListItems");
// Write request body to SharePoint
sharepoint_connection.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(sharepoint_connection.getOutputStream());
writer.write(body);
writer.close();
//sharepoint_connection.connect();
// Read result from SharePoint
BufferedReader reader = new BufferedReader(new InputStreamReader(sharepoint_connection.getInputStream()));
String inputLine;
while ((inputLine = reader.readLine()) != null)
xmltext += inputLine;
reader.close();
} catch (MalformedURLException e) { // new URL() failed
} catch (IOException e) { // openConnection() failed
}