I have problems with downloading text files t phone. This procedure works in emulator but in phone don't

public String sendReceiveHTTP(String strSend)
throws Exception
{

String strTmp = null;

HttpConnection httpconnection;
InputStream inputstream;
strReceive = "";
try
{

httpconnection = (HttpConnection) Connector.open("http://XXXXXXXXXXXXwap/test.txt");
System.out.print("POL ");
httpconnection.setRequestMethod("GET");
httpconnection.setRequestProperty("Content-Length", "" + strSend.length());
httpconnection.setRequestProperty("Content-Type", "text/plain");
httpconnection.setRequestProperty("Connection", "keep-alive");
//
OutputStream outputstream = httpconnection.openOutputStream();
outputstream.write(bytesFromUTF8(strSend)); // s.getBytes("UTF-8");
outputstream.close();
//
int buffSize = (int) httpconnection.getLength();
inputstream = httpconnection.openInputStream();
if (buffSize >= 0)
{
byte abyte0[] = new byte[buffSize];
for (int i = 0; i < buffSize; i += inputstream.read(abyte0, i, buffSize - i))
{
;
}
strTmp = toUTF8(buffSize, abyte0);
}
else
{
int respCode = httpconnection.getResponseCode();
if (respCode == 500)
{
throw new Exception("-----throw B\u0142\u0105d komunikacji!");
}
strTmp = "";
}
strReceive = strTmp.toString();
//
//System.out.print("\n\n ----- open HTTP \n\n");
//
inputstream.close();
httpconnection.close();
//
}
catch (Exception ex)
{
System.out.print("----- B\u0142\u0105d komunikacji! " + ex.getMessage() + "\n");
}
//
//test
//System.out.print("S: " + strSend + "\n");
System.out.print("R: " + strReceive + "\n");
//
return strReceive;
//
}
///************************************************************
//*************************************************************
public static String toUTF8(int l, byte abyte0[])
throws IOException
{
if (l == 1 && abyte0[0] == 1)
{
return "";
}
else
{
return new String(abyte0, "UTF-8");
}
}

Have anybody problem like mine in nokia 7650