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.07-16-2007 07:37 AM
07-16-2007 12:46 PM
if($_REQUEST['add']){
//AGGIUNGO UN NODO
$new_child_store = $currentNode->createChild('cm_folder', 'cm_contains', 'cm_myStore');
$new_child_store->cm_name = 'myStore';
//print_R($new_child);exit;
$session->save();
//$session->clear();
}
Fatal error: Uncaught SoapFault exception: [soapenv:Server.generalException] (null) in C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php:67 Stack trace: #0 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php(67): SoapClient->__soapCall('update', Array, Array, Array, Array) #1 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php(49): AlfrescoWebService->__soapCall('update', Array) #2 [internal function]: AlfrescoWebService->__call('update', Array) #3 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\Session.php(172): AlfrescoWebService->update(Array) #4 C:\Programmi\Apache\htdocs\alfresco2\Examples\SimpleBrowse\index.php(116): Session->save() #5 {main} thrown in C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php on line 67
07-17-2007 08:58 AM
07-17-2007 09:41 AM
session_start();
$repository = new Repository();
$ticket = null;
if (isset($_SESSION["ticket"]) == false)
{
$ticket = $repository->authenticate($user, $password);
$_SESSION["ticket"] = $ticket;
}
else
{
$ticket = $_SESSION["ticket"];
}
$session = $repository->createSession($ticket);
$store = new SpacesStore($session);
$currentNode = null;
if (isset($_REQUEST['uuid']) == false)
{
//set the $currentNode the first time
$currentNode = $store->companyHome;
$path = 'Company Home';
}
else
{
//set the $currentNode while browsing the repository
$currentNode = $session->getNode($store, $_REQUEST['uuid']);
$path = $_REQUEST['path'].'|'.$_REQUEST['uuid'].'|'.$_REQUEST['name'];
}
07-18-2007 04:25 AM
07-20-2007 03:54 AM
07-20-2007 07:25 AM
public function testWriteContentFromFile()
{
$contentData = $this->getContentNode()->cm_content;
$contentData->mimetype = "image/jpeg";
$contentData->encoding = "UTF-8";
$contentData->writeContentFromFile("alfresco/resources/quick.jpg");
$this->getContentNode()->cm_content = $contentData;
$this->getContentNode()->cm_name = "1myDoc_" . time() . ".jpg";
$this->getSession()->save();
}
07-23-2007 01:18 PM
public function updocformfile(){
//$this CONTAIN THE NODE OBJECT
$upload = $this->createChild('cm_content', 'cm_contains', 'cm_ciccio.txt');
$contentData = new ContentData($upload, $property, $mimetype, $encoding);
//$contentData->getContent();
$contentData->mimetype = "text/plain";
$contentData->encoding = "UTF-8";
$contentData->writeContentFromFile("c:/path.txt");
//AT THIS POINT $contentData->content CONTAIN THE CONTENT OF THE FILE
$upload->cm_content = $contentData;
$upload->cm_name = "ciccio.txt";
//HERE IN THE OBJ $upload I HAVE ALL THE PARAMETERS SET UNDER [_properties:private] - I'LL SHOW IT BELOW
$this->getSession()->save();
}
just a portion of $upload object
[_id:private] => sessionTICKET_c29e3208f85cb2a64509fef12c45dd6c4c80cc350
[_type:private] => {http://www.alfresco.org/model/content/1.0}content
[_aspects:private] => Array
(
)
[_properties:private] => Array
(
[{http://www.alfresco.org/model/content/1.0}content] => ContentData Object
(
[_isPopulated:private] =>
[_isDirty:private] => 1
[_node:private] => Node Object
*RECURSION*
[_property:private] => {http://www.alfresco.org/model/content/1.0}content
[_mimetype:private] => text/plain
[_size:private] =>
[_encoding:private] => UTF-8
[_url:private] =>
[_newContent:private] =>
[_newFileContent:private] => c:/path.txt
)
[{http://www.alfresco.org/model/content/1.0}name] => ciccio.txt
)
[_children:private] => Array
(
)
[_parents:private] => Array
(
)
Fatal error: Uncaught SoapFault exception: [HTTP] Internal Server Error in C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php:115 Stack trace: #0 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php(115): SoapClient->__doRequest('<?xml version="…', 'http://localhos…', 'http://www.alfr…', 1) #1 [internal function]: AlfrescoWebService->__doRequest('<?xml version="…', 'http://localhos…', 'http://www.alfr…', 1, 0) #2 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php(67): SoapClient->__soapCall('update', Array, Array, Array, Array) #3 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php(50): AlfrescoWebService->__soapCall('update', Array) #4 [internal function]: AlfrescoWebService->__call('update', Array) #5 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\Session.php(172): AlfrescoWebService->update(Array) #6 C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\Node in C:\Programmi\Apache\htdocs\alfresco2\Alfresco\Service\WebService\AlfrescoWebService.php on line 115
08-02-2007 04:47 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.