我无法将xml数据发布到server.i在向服务器执行请求时遇到错误。错误是INTERNAL SERVER ERROR.please帮助我
public String uploadfiletoserver(String xml)
int TIMEOUT_MILLISEC = 10000; // = 10 seconds
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT_MILLISEC);
HttpConnectionParams.setSoTimeout(httpParams, TIMEOUT_MILLISEC);
HttpClient client = new DefaultHttpClient(httpParams);
HttpPost request = new HttpPost(
url_context + "/orders/order");
try {
Log.i("YMApps Res","In try for setting url encoded form");
StringEntity entity = new StringEntity(xmlString);
entity.setContentType(new BasicHeader(HTTP.CONTENT_TYPE,
"application/xml"));
request.setEntity(entity);
ResponseHandler<String> handler = new BasicResponseHandler();
Log.i("YMApps Res","Inside try before execute");
return client.execute(request, handler);
} catch (Throwable e) {
Log.i("YMApps Res","Inside catch execute");
e.printStackTrace();
}
Log.i("YMApps Res","After try and catch in upload file to server");
return "";
}