cancel
Showing results for 
Search instead for 
Did you mean: 

trying to implement queryParents soap call

simonium
Champ in-the-making
Champ in-the-making
Hi there,  I'm trying to implement the queryParents method of the repositoryService?wsdl of Alfresco web services, but I keep getting the following error message:

Fatal error: Uncaught SoapFault exception: [soapenvSmiley Frustratederver.generalException] (null) in /components/com_joosco/alfresco-php-library/Alfresco/Service/WebService/AlfrescoWebService.php:65
Stack trace:
#0 /components/com_joosco/alfresco-php-library/Alfresco/Service/WebService/AlfrescoWebService.php(65): SoapClient->__soapCall('queryParents', Array, Array, Array, Array)
#1 /components/com_joosco/alfresco-php-library/Alfresco/Service/WebService/AlfrescoWebService.php(47): AlfrescoWebService->__soapCall('queryParents', Array)
#2 [internal function]: AlfrescoWebService->__call('queryParents', Array)
#3 /components/com_joosco/alfresco-php-library/Alfresco/Service/Session.php(90): AlfrescoWebService->queryParents(Array)
#4 /components/com_joosco/views/joosco/view.html.php(81): Session->queryParents(Object(Node))
#5 /libraries/joomla/application/component/controller.php(541): JooscoViewJoosco->display()
#6 /components/com_joosco/alfresco-php-library/Alfresco/Service/WebService/AlfrescoWebService.php on line 65


this is the function I'm trying to call:


$sessionQuery = new Session($repository, $ticket);

      print_r($sessionQuery->queryParents($currentNode));

new function in session.php in Alfresco php library:

public function queryParents($node)

   {

      // Create the store

      $result = $this->repositoryService->queryParents(array("node" => $node));   

      

      // Return the newly created store

      return $result;

   }

can anyone see where I'm going wrong? I think I just need someone a little more experienced with Alfresco to have a look at this.  I'm sure it's something simple.

Thanks in Advance . . .
1 REPLY 1

ddanninger
Champ in-the-making
Champ in-the-making
Hi there,

try that one the documentation isnt always right of the Webservice 😃

Session.php:
public function queryParents($store, $nodeId)
    {

        $result = $this->repositoryService->queryParents(array(
                    "node"=>array(
                                "store"=>$store->__toArray(),
                                "protocol"=>$store->scheme,
                                "path"=>$store->address,
                                "uuid"=>$nodeId
                            )
                    ));                   
                      
        $resultSet = $result->queryReturn->resultSet;       
       
        return $this->resultSetToNodes($this, $store, $resultSet);
    }

And call the Function like:

$spacesStore = new SpacesStore($session);              

$nodeUuid = "fc2ef8d5-0ff3-463d-8e64-a8c266ebec5d";
$result = $session->queryParents($spacesStore, $nodeUuid);

Hope that worked for you too 😃

Best regards
Dominik Danninger