AnsweredAssumed Answered

problem with action response

Question asked by grosisimo on Dec 2, 2008

I need to execute an action and get a value from it as a result.
I've been following the steps listed in
but with no result.

The source I used to call the action webservice in alfresco is:

   String inboundFaxDetailRequestSerialization = getSerializationFromInboundFaxDetailRequest(inboundFaxDetailRequest);
      AuthenticationUtils.startSession(userName, userPassword);
        ActionServiceSoapBindingStub actionService = WebServiceFactory.getActionService();
        Store spacesStore = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
        Reference reference = new Reference(spacesStore, null, "/app:company_home");
        Predicate predicate = new Predicate(new Reference[]{reference}, null, null);
        Action action = new Action();
        NamedValue faxQSer = new NamedValue();
        NamedValue faxRes = new NamedValue();
        NamedValue[] params = new NamedValue[]{faxQSer, faxRes};
        ActionExecutionResult[] actionResults = actionService.executeActions(predicate, new Action[]{action});
        Action actionResult = actionResults[0].getActions(0);
        for (NamedValue nv : actionResult.getParameters()){
           System.out.println(nv.getName() + ": " + nv.getValue());

The action in alfresco is

   public static String PARAM_RESULT = "result";
   protected void executeImpl(Action action, NodeRef actionUponNodeRef) {
      FaxQueryAction faxQueryAction = new FaxQueryAction(ServerConfigurationRegistry.getInstance().getSmtpConfiguration());

      InboundFaxDetailRequest inboundFaxDetailRequest = getInboundFaxDetailRequestFromSerialization(new ByteArrayInputStream(((String)action.getParameterValues().get("inboundFaxDetailRequest")).getBytes()));
      if (!faxQueryAction.faxQuery(inboundFaxDetailRequest)){
         throw new AlfrescoRuntimeException("Failed to make the fax details query");

      //return the string "OK"
      action.setParameterValue(PARAM_RESULT, "OK");

   protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
      paramList.add(new ParameterDefinitionImpl("inboundFaxDetailRequest", DataTypeDefinition.TEXT, true, "inboundFaxDetailRequest"));

The action was called right, but the parameter PARAM_RESULT wasn't returned modified.
I tried making some changes to the source, but I didn't get a response.
Any help please? :cry:

I am using alfresco 2.1. I thought that maybe "value returning" was a new feature in alfresco 2.9. Unfortunately it's not a chance by now to change alfresco version because we are using a program that worked in that version but not in earlier ones.
Do you know if this may be the cause?

Thanks in advance