Отправить JSON-запрос из приложения Blackberry

Как я могу отправить запрос JSON из приложения Blackberry, которое работает в качестве клиента на сервер, чтобы получить информацию от сервера, чтобы использовать их в приложении BB Я использую затмение Blackberry под Windows 7

я пробую этот код

public void loginRequest() throws IOException, JSONException{
    HttpConnection c = null;
    InputStream is = null;
    int rc;

    JSONObject postObject = new JSONObject();
    postObject.put("method", method);
    //postObject.put("params", Parameters);

    try{
        c = (HttpConnection)Connector.open(urlPath);

        // Set the request method and headers
        c.setRequestMethod(HttpConnection.GET);
        c.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
        c.setRequestProperty("Content-Length", "" + (postObject.toString().length() - 2));
        c.setRequestProperty("method", "GET");

        // Getting the response code will open the connection,
        // send the request, and read the HTTP response headers.
        // The headers are stored until requested.
        rc = c.getResponseCode();
        if (rc != HttpConnection.HTTP_OK){
            throw new IOException("HTTP response code: " + rc);
        }

        is = c.openInputStream();

        // Get the length and process the data
        int len = (int)c.getLength();
        if (len > 0){
             int actual = 0;
             int bytesread = 0 ;
             byte[] data = new byte[len];
             while ((bytesread != len) && (actual != -1)){
                actual = is.read(data, bytesread, len - bytesread);
                bytesread += actual;
             }
             //Get the JSON String
            System.out.println(new String(data));
        }
        else{
            int ch;
            while ((ch = is.read()) != -1){
                //TODO
                /*
                process((byte)ch);
                */
            }
        }
    }catch (ClassCastException e){
        throw new IllegalArgumentException("Not an HTTP URL");
    }finally {
        if (is != null)
            is.close();
        if (c != null)
            c.close();
    }
   }

я вызываю этот метод методом run в потоке

когда симулятор дойдет (rc = c.getResponseCode ();) бегущий код останавливается

я отлаживаю код, и он останавливается, когда он достигает этого утверждения с этой ошибкой

Время локального подключения истекло после ~ 120000

любая помощь

Ответы на вопрос(1)

Ваш ответ на вопрос