Android - żądanie HTTP GET

Opracowałem metodę HTTP GET, która wyraźnie działa.

public class GetMethodEx {


public String getInternetData() throws Exception{

        new TrustAllManager();
        new TrustAllSSLSocketFactory();

        BufferedReader in = null;
        String data = null;


        try
        {
            HttpClient client = new DefaultHttpClient();
            URI website = new URI("https://server.com:8443/Timesheets/ping");
            HttpGet request = new HttpGet();
            request.setURI(website);
            HttpResponse response = client.execute(request);
            response.getStatusLine().getStatusCode();

            in = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
            StringBuffer sb = new StringBuffer("");
            String l = "";
            String nl = System.getProperty("line.separator");
            while ((l = in.readLine()) !=null){
                sb.append(l + nl);
            }
            in.close();
            data = sb.toString();
            return data;        
        } finally{
            if (in != null){
                try{
                    in.close();
                    return data;
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
}

Oto ekran drukowania mojego emulatora podczas pobierania odpowiedzi ze strony www.google.com

SCREEN SHOT GOOGLE.COM PRACA

Poniższy kod jest moją metodą pobierania, aby wyświetlić go na ekranie.

public class Home extends Activity {

TextView httpStuff;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.httpexample);
    httpStuff = (TextView) findViewById(R.id.tvhttp);
   new LongOperation().execute("");

}

private class LongOperation extends AsyncTask<String, Void, String> {
  @Override

  protected String doInBackground(String... params) {

      GetMethodEx test = new GetMethodEx();      
      String returned = null;

    try {
        returned = test.getInternetData();

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
        return returned;
  }      

  @Override
  protected void onPostExecute(String result) {    
     httpStuff.setText(result);       
  }

Jednak kiedy próbuję z moim własnym serwerem.

"https: // serwer: port / xwtimesheets / ping"

Mam następujący ekran

MÓJ SERWER, NIE DZIAŁA

questionAnswers(4)

yourAnswerToTheQuestion