title: I am having difficulty with Fiddler detecting HttpClient.execute(get) from a Java Application
body: <p>I'm a programmer currently straddling the fence between .net and Java, but I lean more towards .net with limited experiance with java. I have a Java application, not developed by myself, that does an httpClient execute(get) (get being an HttpsFactory) to get a response back from asp classic code that lives on a different code server found through a specific url with a querystring to store user authentication info. Don't ask me why.</p>
  
  <p>One of the users our qa team is testing with is not returning a good response so I am trying to use fiddler to see what we are getting back. I can see it is connecting because if I enter a malformed password which validated on the asp side. It generated the proper error message and we get it back. Fiddler is not detecting any of this. I've looked at the fiddler sight to try and configure my jvm to go through fiddlers proxy server. But I can't get this to work. I am running java version 1.7.0.21 which I beleive is the latest.</p>
  
  <p>I've run the following in the command prompt</p>
  
  <p>jre -DproxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888
  and
     jre -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888 MyApp</p>
  
  <p>and jre isn't recognized. I also tried:</p>
  
  <p>java -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888 MyApp
  and
     java -DproxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888</p>
  
  <p>the properties are not recognized</p>
  
  <p>I also tried </p>
  
  <p>java -Dhttp.proxySet=true -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888</p>
  
  <p>and I just get the usage for the java command.</p>
  
  <p>I have also tried embedding the following into my code just befoe the http connection and I am still getting no detection.</p>
  
  <pre><code>System.setProperty("http.proxyHost", "127.0.0.1");
  System.setProperty("https.proxyHost", "127.0.0.1");
  System.setProperty("http.proxyPort", "8888");
  System.setProperty("https.proxyPort", "8888");
  </code></pre>
  
  <p>Here java code I am running.</p>
  
  <pre><code>public String getHttpConnect(User user) {
      HttpClient client=https.getHttpClient();
      InputStream instream=null;
      HttpEntity entity=null;
      HttpGet get = https.getHttp(user);
      try {
              response = client.execute(get);
              entity = response.getEntity();
          if (entity != null) {
               instream = entity.getContent();
               Document document= read.read(instream);
              Element root = document.getRootElement();
              String content = root.elementText("permission");
              if (content.equals("OK")) {
                  message = Global.CONNECT_SUCCESS;
              } else {
                  message = ErrorMsg.CONNECT_FAIL;
              }
          }
  
      }catch (Exception e) {
          message = ErrorMsg.CONNECT_EXCEPTION;
          get.abort();
          log.error("HttpConnect error: "+e.toString());
      }finally{
          try {
              if(instream!=null)instream.close();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              System.out.println("Inputstream exception "+e.toString());
              log.error("Inputstream close exception: "+e.toString());
              e.printStackTrace();
              message = ErrorMsg.CONNECT_EXCEPTION;
          }
          client.getConnectionManager().shutdown();
      }
          return message;
  }
  
  public HttpClient getHttpClient() {
      HttpClient client = new DefaultHttpClient();
      client = WebClientDevWrapper.wrapClient(client);
      client.getParams().setParameter(
              CoreConnectionPNames.CONNECTION_TIMEOUT,
              Global.CONNECTION_TIMEOUT);// connect timeout 
      client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT,
              Global.RESPONSE_TIMEOUT);// send data read timeout 
      return client;
  }
  
  public HttpGet getHttp(User user) {
      String psw = user.getAccountpsw();
      StringBuffer connectUrl = new StringBuffer();
      if (Global.CURRENT_RUN_TYPE.equals(Global.BETA)) {
          connectUrl.append(Global.DEFAULT_LOGIN_URL_BETA);
      } else {
          connectUrl.append(Global.DEFAULT_LOGIN_URL_LIVE);
      }
      connectUrl.append("?usr=");
      connectUrl.append(user.getAccountname());
      connectUrl.append("&amp;pwd=");
      connectUrl.append(psw);
      connectUrl.append("&amp;vers=2.5.20&amp;");
      connectUrl.append(random());
      // connectUrl.append("&amp;SkipCheckForFiles=TRUE");
      StringBuffer logConnect = new StringBuffer();
      logConnect.append("Logging into server using URL:");
      logConnect.append(Global.LOG_NEWLINE);
      logConnect.append(Global.DES.getLogEncString(connectUrl.toString()));
      logConnect.append(Global.LOG_NEWLINE);
      log.info(logConnect);
      HttpGet get = new HttpGet(connectUrl.toString());
      return get;
  }
  </code></pre>
  
  <p>Thanks for all of your help, regardless of the outcome.</p>