public static String sendXMLDataByPost( String url,String xmlData) throws ClientProtocolException, IOException {
Integer statusCode = -1;
if (httpClient == null) {
httpClient = new DefaultHttpClient();
}
HttpPost post = new HttpPost(url);
StringEntity entity = new StringEntity(xmlData);
post.setEntity(entity);
post.setHeader("Content-Type", "text/xml;charset=UTF-8");
HttpResponse response = httpClient.execute(post);
statusCode = response.getStatusLine().getStatusCode();
System.out.println("返回狀態:"+statusCode);
// 獲取返回數據
HttpEntity repEntity = response.getEntity();
String body = EntityUtils.toString(repEntity,"UTF-8");
return body;
}