AnsweredAssumed Answered

REST calling problem

Question asked by sarkar92 on Jul 8, 2013
Latest reply on Jul 9, 2013 by frederikheremans1
I have successfully installed activiti for dev environment.
We use activiti-rest  in our application.
But now whenever I try to start a simple process I am getting "Bad Request (400) - Bad Request".
Here is my code …

public static ClientResource getClientResource(String uri,String userName,String password) {
      System.out.println("in getClientResource password:"+password);
               ClientResource clientResource = new ClientResource(uri);
               clientResource.setChallengeResponse(ChallengeScheme.HTTP_BASIC,userName, password);
               return clientResource;

public static String startRequestedProcess(HashMap<String,Object> param,String userName,String password)
      throws Exception {
          String uri = "http://localhost:9090/activiti-rest/service/runtime/process-instances";
           JSONObject object=new JSONObject();
           Set s=param.keySet();
          Iterator<String> itr= s.iterator();
                object.put(key, param.get(key));
                System.out.println(key +" "+param.get(key));
           Representation rep = new JsonRepresentation(object);
           JSONObject jsObj = new JSONObject(getClientResource(uri,userName,password).post(rep).getText());
 "Returning processId " + jsObj.getString("id"));
           return jsObj.getString("id");

   public static void main(String args[]) throws Exception{
      HashMap<String, Object> param = new HashMap<>();
      param.put("processDefinitionKey", "testRestProcess");
      }catch(ResourceException e){   
         System.out.println("===== > "+e.getMessage());
         System.out.println("===== >"+e.getStatus());   

is something wrong in my code??