@@ -0,0 +1,2022 @@
+package org.ow2.proactive.procci.request;%0A%0Aimport lombok.AllArgsConstructor;%0Aimport org.json.simple.JSONObject;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.DataOutputStream;%0Aimport java.io.InputStreamReader;%0Aimport java.net.HttpURLConnection;%0Aimport java.net.URL;%0A%0A/**%0A * Created by mael on 02/06/16.%0A */%0A@AllArgsConstructor%0Apublic class CloudAutomationRequest %7B%0A%0A    private static final String PCA_SERVICE = %22http://localhost:4444%22;%0A%0A    private final JSONObject content;%0A%0A    public String sendRequest()%7B%0A        String result;%0A        try%7B%0A%0A            URL obj = new URL(PCA_SERVICE);%0A%0A            HttpURLConnection con = (HttpURLConnection) obj.openConnection();%0A%0A            //add request header%0A            con.setRequestMethod(%22POST%22);%0A%0A            con.setRequestProperty(%22Content-Type%22, %22application.json%22);%0A            con.setRequestProperty(%22Accept%22, %22application/json%22);%0A%0A            //String urlParameters = %22%22;%0A%0A            // Send post request%0A            con.setDoOutput(true);%0A            DataOutputStream wr = new DataOutputStream(con.getOutputStream());%0A            //wr.writeBytes(urlParameters);%0A            wr.writeBytes(content.toJSONString());%0A            wr.flush();%0A            wr.close();%0A%0A            int responseCode = con.getResponseCode();%0A            System.out.println(%22%5CnSending 'POST' request to URL : %22 + PCA_SERVICE);%0A            //System.out.println(%22Post parameters : %22 + urlParameters);%0A            System.out.println(%22Response Code : %22 + responseCode);%0A%0A            BufferedReader in = new BufferedReader(%0A                    new InputStreamReader(con.getInputStream()));%0A            String inputLine;%0A            StringBuffer response = new StringBuffer();%0A%0A            while ((inputLine = in.readLine()) != null) %7B%0A                response.append(inputLine);%0A            %7D%0A            in.close();%0A%0A            result = response.toString();%0A        %7Dcatch (Exception e)%7B%0A            result = %22Exception in Compute : %22+e.getMessage();%0A        %7D%0A%0A        return result;%0A    %7D%0A%0A%7D%0A

add a service in order to send json request to pca-service