AnsweredAssumed Answered

Problem creating new Nodes with the PHP Library

Question asked by plaico on Jul 16, 2007
Latest reply on Jun 12, 2009 by ofrxnz
There are two things I'd like to know about the PHP Library. Firstly, I could not manage it to create a new node using the following code:

$new_child = $currentNode->createChild('cm_content', 'cm_contains', 'cm_phpinfo.php');
$new_child->cm_name = 'phpinfo.php';
$new_child->setContent('cm_content', 'text/plain', 'UTF-8', 'blablabla');
I always get the the same error message:

Fatal error: Uncaught SoapFault exception: [soapenv:Server.generalException] WSDoAllReceiver: security 

processing failed; nested exception is: org.apache.ws.security.WSSecurityException: General security error

(WSSecurityEngine: Callback supplied no password for: username) in

/var/www/localhost/htdocs/alfrescophp/Alfresco/Service/WebService/AlfrescoWebService.php:67 Stack trace:

#0 /var/www/localhost/htdocs/alfrescophp/Alfresco/Service/WebService/AlfrescoWebService.php(67):

SoapClient->__soapCall('query', Array, Array, Array, Array) #1

/var/www/localhost/htdocs/alfrescophp/Alfresco/Service/WebService/AlfrescoWebService.php(49):

AlfrescoWebService->__soapCall('query', Array) #2 [internal function]: AlfrescoWebService->__call('query',

Array) #3 /var/www/localhost/htdocs/alfrescophp/Alfresco/Service/Session.php(226):

AlfrescoWebService->query(Array) #4

/var/www/localhost/htdocs/alfrescophp/Alfresco/Service/SpacesStore.php(48):

Session->query(Object(SpacesStore), 'PATH:"app:compa…') #5 /var/www/localhost/htdocs/alfrescoph in

/var/www/localhost/htdocs/alfrescophp/Alfresco/Service/WebService/AlfrescoWebService.php on line 67
Probably, some of the params are wrong, but I couldn't find anything about it in the documentation and all the other forum threads I looked at used the same code as I do.

The next thing I have problems with is the correct way to upload files. There is already a variable in the Node class but the SetContent-function has no line which would set a value to this variable. Therefore, I changed the function to set this variable but due to my first problem, I could not test this properly because I got to the same SOAPFault exception as above.
Are there any more examples?

Outcomes