=====================================================================================

 

OutputStream os = res.getOutputStream();

XMLEncoder xmlEnc = new XMLEncoder(os);

xmlEnc.writeObject(vo);

xmlEnc.flush();

xmlEnc.close();

 

=====================================================================================

 
URL url = new URL(serverIp+"/eventIfInsert.ws");
httpConn = (HttpURLConnection)url.openConnection();
 
//POST 방식으로 넘김
httpConn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
 
OutputStream out_stream = httpConn.getOutputStream();
out_stream.write(param.toString().getBytes("UTF-8"));
out_stream.flush();
out_stream.close();
 
InputStream is = httpConn.getInputStream();
 
XMLDecoder xmlDec = new XMLDecoder(is);
 
@SuppressWarnings("unchecked")
Map<String, String> tmpMap = (Map<String, String>)xmlDec.readObject();
 
 

 

Posted by 張's blog
,