Problem creating new Nodes with the PHP Library
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2007 04:21 AM
$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?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2007 09:50 AM
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 C:\webdev\apps\inc\Alfresco\Service\WebService\AlfrescoWebService.php:65 Stack trace: #0 C:\webdev\apps\inc\Alfresco\Service\WebService\AlfrescoWebService.php(65): SoapClient->__soapCall('queryChildren', Array, Array, Array, Array) #1 C:\webdev\apps\inc\Alfresco\Service\WebService\AlfrescoWebService.php(47): AlfrescoWebService->__soapCall('queryChildren', Array) #2 [internal function]: AlfrescoWebService->__call('queryChildren', Array) #3 C:\webdev\apps\inc\Alfresco\Service\Node.php(480): AlfrescoWebService->queryChildren(Array) #4 C:\webdev\apps\inc\Alfresco\Service\Node.php(379): Node->populateChildren() #5 C:\webdev\apps\inc\Alfresco\Service\BaseObject.php(37): Node->getChildren() #6 C:\webdev\apps\inc\Alfresco\Service\Node.php(274): BaseObject- in C:\webdev\apps\inc\Alfresco\Service\WebService\AlfrescoWebService.php on line 65
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2007 10:30 AM
//create a folder in root alfresco root directory function createFol($currentNode,$session) { $new_child_store = $currentNode->createChild( 'cm_folder', 'cm_contains', 'app_myStore' ); $new_child_store->addAspect("cm_titled"); $new_child_store->cm_name = 'myStore'; $new_child_store->cm_title = "This is a title"; $new_child_store->cm_description = "This is a description"; $session->save(); } //create a document in alfresco root directory function createDoc($store,$session) { $filename = "pippo_".time()."_.txt"; $content_data = $store->getCompanyHome()->createChild( "cm_content", "cm_contains", "cm_" .$filename ); $content_data->cm_name = $filename; $content_data->cm_title = ("This is my new document."); $content_data->cm_description = ("tag1;tag2;tag3;"); $content_data->setContent("cm_content", "text/plain", "UTF-8", "testTESTtestBlaBLABlaBla"); $session->save(); $nodeID = $content_data->id; $doc = $session->getNode($store, $nodeID); //print_r($doc->cm_name); //–>PER VISUALIZZARE IL NOME DEL FILE $doc_view = $doc->cm_content; //print_r($doc_view->content); //–>PER VISUALIZZARE IL CONTENUTO DEL FILE } //navigate the tree from a point of the file system function navigate($store,$session) { $id = "6f44ec91-442c-11dc-944e-db4a961e19e4"; //naviga partendo dalla cartella Servizi Finanziari //$id = "7dbb786e-442c-11dc-944e-db4a961e19e4"; // naviga partendo dalla cartella Servizi Postali $node = $session->getNode($store, $id); foreach($node->children as $child) { if($child->child->type == "{http://www.alfresco.org/model/content/1.0}folder") { $id = $child->child->id; } if($child->child->type == "{http://www.alfresco.org/model/content/1.0}content") { $content = $child->child->cm_content; $id = $content->getUrl(); } echo $id." "; echo $child->child->cm_name."<br>"; } } //here i call the listed functions //createFol($currentNode,$session); //createDoc($store,$session); //navigate($store,$session);
It works fine to me,
Hope it can help
mirko
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2007 02:57 PM
i get the same, unified soap (update) errors for totally different problems. how can i reveal a more specific description about the real, underlying problem, like
"file already exists" or "the space doesn't exists".
thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2007 04:54 AM
Regards,
Kaspar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2007 10:40 AM
$name = 'blabla'; $mime = 'application/pdf'; $n = $home->createChild('cm_content', 'cm_contains', 'cm_'.$name); $n->cm_name = $name; $content = new ContentData($n, 'cm_content', $mime, 'UTF-8'); $content->writeContentFromFile('/tmp/test.pdf'); $n->cm_content = $content; $session->save();
Best,
Kaspar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2007 05:52 PM
<session-timeout>30</session-timeout>
does not contain 30 but some ridicuously large number. (Needless to say that this is not a good thing to do in a production environment, but it works around the problem at least.)Hope this helps others as well,
Kaspar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2008 08:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2008 09:00 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2009 08:26 AM
The issue is not creating new nodes but trying to create/overwrite a node when one already exists with that name.
any one have any ideas on how to update.
here is my error
Fatal error: Uncaught SoapFault exception: [soapenv:Server.generalException] (null) in C:\xampp\htdocs\joomla\components\com_alfrescodropbox\Alfresco\Service\WebService\AlfrescoWebService.php:65 Stack trace: #0 C:\xampp\htdocs\joomla\components\com_alfrescodropbox\Alfresco\Service\WebService\AlfrescoWebService.php(65): SoapClient->__soapCall('update', Array, Array, Array, Array) #1 C:\xampp\htdocs\joomla\components\com_alfrescodropbox\Alfresco\Service\WebService\AlfrescoWebService.php(47): AlfrescoWebService->__soapCall('update', Array) #2 [internal function]: AlfrescoWebService->__call('update', Array) #3 C:\xampp\htdocs\joomla\components\com_alfrescodropbox\Alfresco\Service\Session.php(168): AlfrescoWebService->update(Array) #4 C:\xampp\htdocs\joomla\components\com_alfrescodropbox\controller.php(64): Session->save() #5 C:\xampp\htdocs\joomla\components\com_alfrescodropbox\controller.php(96): AlfrescoDropBoxController->postFile() #6 C:\xampp\htdocs\joomla\libraries\joomla\application\component\controller.php(236): Alfres in C:\xampp\htdocs\joomla\components\com_alfrescodropbox\Alfresco\Service\WebService\AlfrescoWebService.php on line 65