org.apache.http.client.HttpClient 怎么发送一段xml到服务器啊

注意: 这里的httpclient不是common包下的 是org.apache.http.client.HttpClient

1 org.apache.http.client.HttpClient 有没有注入setQueryString("")这样的方法呢.

2 或者有没其他方法来发送一段xml文件

3 org.apache.http.client.HttpClient 可不可以获取httprequest 如果可以获取又应该怎么获取呢
[b]问题补充:[/b]
谢谢 yuankai
只是你提供的代码 其实是基于common包下的httpclient 不是我所要的。谢谢。
[b]问题补充:[/b]
common包下提交请求的两个对象:PostMethod GetMethod

我想要的提交请求的两个对象的是 HttpPost HttpGet

这个是在网上看到的,我稍微改了下,这样能满足你的需求吗?
public static void main(String[] args) throws IOException
{
HttpClient client = new HttpClient();
client.getHostConfiguration().setHost("localhost:8080/test", 80, "http");
String xmlStr = "你的XML串";
HttpMethod method = getPostMethod(xmlStr);
client.executeMethod(method);
//打印服务器返回的状态
System.out.println(method.getStatusLine());
//打印结果页面
String response =
new String(method.getResponseBodyAsString().getBytes("8859_1"));
//打印返回的信息
System.out.println(response);
method.releaseConnection();
}
private static HttpMethod getPostMethod(String xmlStr){
PostMethod post = new PostMethod("/test.jsp");
NameValuePair simcard = new NameValuePair("id",xmlStr);
post.setRequestBody(new NameValuePair[] { simcard});
return post;
}

我参考了以下文章:
http://www.iteye.com/problems/9067
http://hc.apache.org/httpcomponents-client/httpclient/apidocs/
http://hc.apache.org/httpcomponents-client/httpclient/apidocs/org/apache/http/client/HttpClient.html

public static void main(String []args){
HttpClient httpclient = new DefaultHttpClient();
HttpPost httpost = new HttpPost("你的地址");
// 构建参数
List nvps = new ArrayList ();
[color=red] nvps.add(new BasicNameValuePair("xmlString", xmlString));[/color]
httpost.setEntity(new UrlEncodedFormEntity(nvps,HTTP.UTF_8));

//Examine the response status
HttpResponse response = httpclient.execute(httpost);

//打印服务器状态
System.out.println(response.getStatusLine());
// Get hold of the response entity
HttpEntity entity = response.getEntity();

if (entity != null) {
   InputStream instream = entity.getContent();
   try {        
      BufferedReader reader = new BufferedReader(
             new InputStreamReader(instream));
      System.out.println(reader.readLine());
    } catch (IOException ex) {
       throw ex;
    } catch (RuntimeException ex) {
       httpget.abort();
       throw ex;
   } finally {
      instream.close();
  }

}
}