Кажется, что ваша проблема здесь (см. встроенные комментарии):
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
wr.writeBytes(urlParameters);
// you wrote your URL parameters into Body
wr.flush();
wr.close();
//You closed your body and told server - you are done with request
conn.getOutputStream().write(postDataBytes);
// you wrote data into closed stream - server does not care about it anymore.
urlParameters
прямо к URL-адресу при его открытии conn.getOutputStream().write(postDataBytes);