As i am new to android Please provide me the link of the tutorial to post xml data on the server. I am facing the problem is executing the post request
public void uploadFileToServer()
{
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url_context + "/orders/order");
httppost.addHeader("Accept", "text/xml");
httppost.addHeader("Content-Type", "application/xml");
try
{
StringEntity entity = new StringEntity(xmlString, "UTF-8");
entity.setContentType("application/xml");
httppost.setEntity(entity);
HttpResponse response = httpClient.execute(httppost);
BasicResponseHandler responseHandler = new BasicResponseHandler();
String strResponse = null;
if (response != null)
{
try {
strResponse = responseHandler.handleResponse(response);
} catch (HttpResponseException e)
{
e.printStackTrace();
} catch (IOException e)
{
e.printStackTrace();
}
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
}