• OKMDocument.create throws exception

  • Do you want to create a native client or integrate with third party applications: webservices are the solution.
Do you want to create a native client or integrate with third party applications: webservices are the solution.
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.
 #28208  by Supriya
 
HI

When i run OKMDocument.create(token, doc, FileUtil.readFile(localFileName));

it throws exception as "cafebabe-cafe-babe-cafe-babecafebabe"

Why is this exception
Code: Select all
ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateServerCertificate);
webservice = OKMWebServiceFactory.getInstance(host, user, password, OKMWebServiceFactory.COMMUNITY_6_0);
token = webservice.login();           
authService = new OKMAuth(host);             
documentService = new com.openkm.ws.community.ws60.OKMDocument(host);           
token = token = authService.login("okmAdmin", "admin");
// create document
com.openkm.ws.community.ws60.document doc = new com.openkm.ws.community.ws60.document();          
doc.path = @"\okm:root\";
string localFileName = @"hosts.txt";            
documentService.create(token, doc, FileUtil.readFile(localFileName));               
authService.logout(token);
webservice.logout(token);
Thanks
Supriya
 #28218  by jllort
 
Here I see two errors doc.path = @"\okm:root\";
First this is not a path, path should be something like "/okm:root/document.txt"
Second wrong use of \ really the character to indicate path is /

I think with this changes you'll get solved

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.