URL url = new URL("http://localhost:8080/");//servlet url  
URLConnection conn = url.openConnection();                 
conn.setRequestProperty("Content-Type","text/xml");        
conn.setDoOutput(true);                                    
conn.setDoInput(true);                                     
                                                           
OutputStream out = urlc.getOutputStream();                 
out.write("");//发送给servlet的其他信息                      
out.flush();                                               
out.close();                                               
                                                           
InputStream in = connn.getInputStream();                   
String result = StreamUtil.streamToString(in);             
System.out.println(result);