• setContent function non valid

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #44185  by Xeyos
 
I have this problem,
i try to update one document by API (PHP)
this is my code:
Code: Select all
$OKMDocument = new SoapClient('http://localhost:8080/OpenKM/services/OKMDocument?wsdl');
...
$this->OKMDocument->checkout(array('token' => $this->token, 'docPath' => $path));
$this->OKMDocument->setContent(array('token' => $this->token, 'docPath' => $path, 'content' => file_get_contents($file)));
But i have this error:
Function ("setContent") is not a valid method for this service
 #44193  by jllort
 
I suggest forget Soap, we are no longer support it, consider deprecated and in near future we will definitively remote it. Really in the next professional version after advising the last 3 years it has been removed.

I suggest use our PHP SDK based in REST webservices, you can find it here https://docs.openkm.com/kcenter/view/sdk4php-1.1.1/
 #44238  by Xeyos
 
I integrate the sdk as external library and i change all SOAP request with the API in sdk.
Now all works correctly.

For other user this is my solution to ingrate the sdk with Symfony framework.

1) Paste the content of src(openkm and Httpful) folder in your vendor project folder, both folders under one folder called for example openkm.
2)Modify you autoload.php file
Code: Select all
$loader->add('openkm',__DIR__.'/../vendor/openkm');
$loader->add('Httpful',__DIR__.'/../vendor/openkm');
Now in your class you can use all classes of SDK example: (I create my utility service)
Code: Select all
use openkm\OKMWebServicesFactory;
Thx

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.