//引用import org.apache.commons包
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
public static String post(String request) throws Exception{
PostMethod postMethod = new PostMethod(URL);byte[] b = request.getBytes("utf-8");
InputStream is = new ByteArrayInputStream(b,0,b.length);
RequestEntity re = new InputStreamRequestEntity(is,b.length,“text/xml; charset=utf-8”);
postMethod.setRequestEntity(re);
HttpClient httpClient = new HttpClient();
int statusCode = httpClient.executeMethod(postMethod);
String rs = postMethod.getResponseBodyAsString();
return rs;
}