URLConnection urlCon = null;
OutputStreamWriter out = null;
BufferedReader reader = null;
InputStreamReader ir = null;
InputStream input = null;
OutputStream raw = null;
OutputStream buf = null;
String xmlString = "";
try
{
urlCon = new URL(urlStr).openConnection();
urlCon.setRequestProperty("Content-Type", "text/xml; charset=UTF-8");
urlCon.setRequestProperty("Accept",
"application/x-www-form-urlencoded");
urlCon.setRequestProperty("version", "100");
urlCon.setRequestProperty("Keep-Alive", "300");
urlCon.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
urlCon.setDoOutput(true);
urlCon.setDoInput(true);
urlCon.setReadTimeout(NUM_SIXTY_THOUSAND);
raw = urlCon.getOutputStream();
buf = new BufferedOutputStream(raw);
out = new OutputStreamWriter(buf, "UTF-8");
out.write(xmlMsg);
out.flush();
input = urlCon.getInputStream();
ir = new InputStreamReader(input, "UTF-8");
reader = new BufferedReader(ir);
String line = null;
StringBuffer xmlStr = new StringBuffer();
while ((line = reader.readLine()) != null)
{
xmlStr.append(line);
}
xmlString = xmlStr.toString().trim();
}
return xmlString;