title: Consume Rest-Webservice in java 1.6 version
body: <p>Need to consume post method in  Rest webservice using java 1.6 version,I have used Jersey jar to connect web services but getting connect rest error when iam running it in JAVA 1.6 Version , But its working fine using java 1.7 and 1.8.</p>
  
  <p>Can some one help me to achive this using JAVA 1.6 version because i need to deploy in server which runs on java 1.6.</p>
  
  <p>Iam Connecting to URL :https:// (secured url)</p>
  
  <p>Code Below:</p>
  
  <pre><code>import java.util.ArrayList;
  
  import javax.ws.rs.client.Client;
  
  import org.json.simple.JSONArray;
  import org.json.simple.JSONObject;
  
  import com.sun.jersey.api.client.WebResource;
  import com.thortech.util.logging.Logger;
  
  public class MFARestClientService {
  
     public static void main(String[] args) {
  
          MFARestClientService mfa1=new MFARestClientService();
          ArrayList userList = new ArrayList();
          userList.add("test1");
          userList.add("Test2");
  
          mfa1.postMFAUser(userList);
      }
  
  
      Logger logger = Logger.getLogger("RestClientService");
      //Method To post data to AsureCloud
         public void postUser(ArrayList&lt;String&gt; userList)
         {
  
          JSONObject obj = new JSONObject();
          String url = "https://***.azurew.net/********************************/*****";
          this.logger.info("Reached RestClientService");
          this.logger.info("Get UserDetails from OIM usr table and creating json value");
  
          obj.put("group", "ABC-99");
          obj.put("userid", userList);
          String jsondata=obj.toJSONString();
          System.out.println("JSONDATA :"+jsondata);
  
  
        {
         try {
  
             this.logger.info(jsondata);
             Client restClient = Client.create();
             WebResource webResource = restClient.resource(url);
             ClientResponse response = webResource.accept("application/json").post(ClientResponse.class,jsondata);
             if (response.getStatus() != 200) {
                 throw new RuntimeException("Failed : HTTP error code : "  + response.getStatus());
  
              }
               String output = response.getEntity(String.class);
               System.out.println("Output from Server .... \n");
               this.logger.info("Output from Server .... \n");
               this.logger.info(output);
               System.out.println(output);
  
           } catch (Exception e) {
  
               e.printStackTrace();
  
           }
  
         }
        }
  }
  </code></pre>
  
  <p>Error:
  Connection reset</p>
  
  <p>But this code work fine in java 1.7 and 1.8</p>
  
  <p>Need help to consume this using java 1.6 version </p>
  
  <p>Thanks 
  Midhun M S</p>